How could I finish the for loop?
Ältere Kommentare anzeigen
I am writing a for loop. like this,
%
stations=[1 1 1 2 2 2 3 3 3];
stats=[1 2 3];
datapb=[];
for i=1:length(station(s))
[row,col]=find(stations(i)==stats(1));
dataps=max(datap(row));
datapb=[datapb;dataps];
end
[DEPTH, ia3, ic3] = unique(datapb,'stable');
%
I would like to obtain three DEPTH by change the stats from stats(1) to stats(3). How could I use two for loop to finish the calculation? Thank you very much in advance!
2 Kommentare
Krithika A
am 24 Jul. 2018
I don't understand what you are trying to do. Can you elaborate on your aim?
Pingyang Li
am 24 Jul. 2018
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements 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!