Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

an_example #15

Open
Marina-red opened this issue Nov 5, 2020 · 4 comments
Open

an_example #15

Marina-red opened this issue Nov 5, 2020 · 4 comments

Comments

@Marina-red
Copy link

Hello! I'm trying to run an_example.m on matlab 2014b
And there is an error:
Error using >=
Matrix dimensions must agree.

Error in detect (line 176)
data_thre=num2cell(temp_clim(:,:,any(ind_fake'>=(ind_fake(fake_doy == i)-vWindowHalfWidth) & ind_fake' <= (ind_fake(fake_doy
==i)+vWindowHalfWidth),2)),3);

Error in an_example (line 28)
[MHW,mclim,m90,mhw_ts]=detect(sst_full,datenum(1982,1,1):datenum(2016,12,31),datenum(1982,1,1),datenum(2005,12,31),datenum(1993,1,1),datenum(2016,12,31));;
%take about 30 seconds.

What it can be?

@pittwolfe
Copy link

I get a similar error on the same line using Matlab 2018a, except my error is The logical indices in position 3 contain a true value outside of the array bounds and it occurs for i = 366.
It seems like its trying to read a time outside the bounds of my input data, but the climatology range I have it is well inside my data.
My climatological range is Jan 1 1990 to Dec 31 1995, which contains a leap year.

@Marina-red
Copy link
Author

In version 2019b my error disappeared

@pittwolfe
Copy link

It turns out that my problem was that my "time" variable had days and hours in it rather than just full days, which confused the search. Might be worth putting in a line to round the times to whole days to avoid this in the future.

@ZijieZhaoMMHW
Copy link
Owner

@pittwolfe Thanks for the suggestion. We would make the change in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants