Number in a cell to a row number in loop.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello! I have a matrix containing numbers [8 88 67 74] and so on, and I want matlab to take these numbers as 'row numbers' of an another matrix. How should I do this?
2 Kommentare
Akzeptierte Antwort
Bob Thompson
am 3 Apr. 2018
If you're just looking to use those values as row selection you can enter them as the index of your value:
for k = 1:length(rownums);
results = data(rownums(k),:); % Include your operations here, but the indexing for your data should call
% the entire row specified by the kth value of your first matrix of row
% numbers.
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!