For a certain lon a lat:
days=13;
for indice=1:days
c1=max(max(u0(lon_useful,lat_useful,1,indice)));
save('fev_fim_2019.mat','c1');
end
How can I save c1 without it being severe on the top each time i run the code?
I've tried :
save('fev_fim_2019.mat','c1(indice)');
But give me the following error:
Error using save
'c1(indice)' is not a valid variable name.

댓글 수: 2

Mathieu NOE
Mathieu NOE 2021년 4월 28일
hello
what do you mean by "severe" ?? I don't understand the sentence :
How can I save c1 without it being severe on the top each time i run the code?
Jan
Jan 2021년 4월 28일
편집: Jan 2021년 4월 28일
Your code overwrites the file 'fev_fim_2019.mat' in each iteration. What about collecting the data inside the loop and saving it afterwards?
By the way, this singular of "indices" is "index".

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2021년 4월 28일

0 개 추천

Maybe you can omit the loop:
days = 13;
c = max(u0(lon_useful, lat_useful, 1, 1:days), [], 4);
save('fev_fim_2019.mat', 'c');

카테고리

도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2021년 4월 28일

답변:

Jan
2021년 4월 28일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by