How to find out the value of a matrix corresponding row and column?
1 回表示 (過去 30 日間)
古いコメントを表示
Hello I have index of a matrix x=[1;2;3] & y=[1;1;2]. Now how to check what value in which index of the matrix.Suppose the matrix is z=[0 4;5 6;1 0]. Now how can I check what is the value of (x,y) index.Please help.
0 件のコメント
採用された回答
Stephen23
2019 年 8 月 30 日
>> x = [1;2;3];
>> y = [1;1;2];
>> z = [0,4;5,6;1,0];
>> z(sub2ind(size(z),x,y))
ans =
0
5
0
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!