-
Notifications
You must be signed in to change notification settings - Fork 19
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
Index exceeds the number of array elements. Index must not exceed 12784. #24
Comments
@Smabmn May I ask how you run the code? I run the example on my local machine and there is no error reported. Cheers, |
@Smabmn |
your data. %% An example about how to apply m_mhw to real-world data % Load NOAA OI SST V2 data % This data includes SST in [147-155E, 45-37S] in resolution of 0.25 from load('lon_and_lat'); % Here we detect marine heatwaves off eastern Tasmania based on the % Additionally, we also detect MCSs during 1982 to 2005 based on the same [MCS,~,m10,mcs_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),'Event','MCS','Threshold',0.1); % Have a look of these two data. % You could see that the properties datevec(num2str(MHW{1:5,:}),'yyyymmdd') % vector %% 3. Visualizing MHW/MCS time series % Have a look of MHW events in grid (1,2) from Sep 2015 to Apr 2016 % Have a look of MCS events in grid (1,2) during 1994 % %% 4. Mean states and trends % Please note that this section requires the toolbox m_map % Now we would like to know the mean states and annual trends of MHW [mean_freq,annual_freq,trend_freq,p_freq]=mean_and_trend_new(MHW,mhw_ts,1982,'Metric','Frequency'); % These four outputs separately represent the total mean, annual mean, % This function could detect mean states and trends for six different metric_used={'Frequency','MeanInt','MaxInt','CumInt','Duration','Days'}; for i=1:6; % plot mean and trend % It could be detected that, as a global hotspot, the oceanic region off figure('pos',[10 10 1500 1500]); for i=1:6;
end %% 5. Applying cluster algoirthm to MHW - A kmeans example. % We get so many MHWs now.... Could we distinguish them into different % Change it to matrix; % Extract mean, max, cumulative intensity and duration. [data_for_k,mu,sd]=zscore(MHW_m); % Determine suitable groups of kmeans cluster.
end figure('pos',[10 10 1500 1500]); subplot(1,2,2); % Use 9 groups. k=kmeans(data_for_k,9,'Distance','cityblock','maxiter',200); k_9=[]; loc_x=[1.5 1.5 1.5 2.5 2.5 2.5 3.5 3.5 3.5]; figure('pos',[10 10 1500 1500]); h=subplot(2,2,1); h=subplot(2,2,2); h=subplot(2,2,3); h=subplot(2,2,4); % Their associated SSTA patterns % Calculate SSTA time_used=datevec(datenum(1982,1,1):datenum(2016,12,31)); ssta_full=NaN(size(sst_full)); for i=1:size(m_d_unique); sst_1993_2016=ssta_full(:,:,(datenum(1993,1,1):datenum(2016,12,31))-datenum(1982,1,1)+1); for i=1:9;
end color_used=hot; plot_index=[1 4 7 2 5 8 3 6 9]; for i=1:9;
end hp4=get(subplot(3,3,9),'Position'); |
@Smabmn Cheers, |
No differences, |
@Smabmn |
When I run the example this error appears
Index exceeds the number of array elements. Index must not exceed 12784.
Error in event_line (line 84)
y1=m90_plot(x1-datenum(data_start,1,1)+1);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The text was updated successfully, but these errors were encountered: