Number in a cell to a row number in loop.
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Bob Thompson
2018-4-3
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!