ZijieZhaoMMHW / m_mhw1.0

A MATLAB toolbox to detect and analyze marine heatwaves (MHWs).
GNU General Public License v3.0
45 stars 19 forks source link

Error in evaluating .mat files #10

Closed keegancarvalho28 closed 5 years ago

keegancarvalho28 commented 5 years ago

I'm trying to focus on MHW in the coastal areas of Greenland. Loaded the "sst" data and saved them as .mat files in the appropriate folder. I get an error:

Error using eval Undefined function or variable 'sst_2006'.

Here's my code: `

sst_full=NaN(280,112,datenum(2018,12,31)-datenum(2006,1,1)+1); for i=2006:2016; filehere=['sst' num2str(i)]; load(file_here); eval(['datahere=sst' num2str(i) ';']) sst_full(:,:,(datenum(i,1,1):datenum(i,12,31))-datenum(2006,1,1)+1)=data_here; end`

Would be grateful to receive some help in this. OR is there another easier code of combining the files?

ZijieZhaoMMHW commented 5 years ago

Hi,

I am willing to help. Would you mind describing your question and send an email to me via (zijiezhaomj@gmail.com)? It could be better if you can describe your data detailedly or may send me a screen shot of your data?

Zijie

keegancarvalho28 commented 5 years ago

Thanks Sir!

I figured it out. Somehow I need to save the .mat files and load them immediately. It works. But if I save the .mat files and restart Matlab after few hours or days, i get the "evaluation error".

Thank you.

Keegan