how to write if statement into for loop?
Ältere Kommentare anzeigen
Hi all,
I have scattered data and I want to put them together and exclude the other which is not locate along the main axis, the statement of excluded data is
Longitude>43
and the loop is
for i=1:24
t_interp(:,i)=interp1(z(~isnan(z(:,i)),i),t(~isnan(t(:,i)),i),depth);
s_interp(:,i)=interp1(z(~isnan(z(:,i)),i),sal(~isnan(t(:,i)),i),depth);
end
i cant understand how to write it into the loop, I'm appreciate anyone can help me sorry for my bad English thank you in advance
3 Kommentare
Star Strider
am 24 Mai 2014
It looks as though you just did write it in a loop.
- What is it not doing that it should?
- What is it doing that it should not?
- Do the interp1 statements work outside of the loop?
dpb
am 24 Mai 2014
Think he means to how include the condition, SS...
@lina, what is the variable for Longitude? Need more info...
lina
am 24 Mai 2014
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!