フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to find a spesific row value and write it in to a matrix?

1 回表示 (過去 30 日間)
Iremsu Savas
Iremsu Savas 2018 年 10 月 15 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello all,I have a matrix A(25,3,4) and in the third column I want to show the index of third dimension value. For example for the first dimension: val(:,:,1) 2 5 _ 3 4 _ . . . and inside of it there are 25 integer numbers,and ı want to add "1" to the third column that i mentioned with _ because of the third dimensions number Or for a value inside of the second dimension val(:,:,2) 3 5 _ 2 4 _ . . .
Then ı want it to write the third column "2" that comes from the dimension number. Is it possibile to write it? I hope my question is clear. Thank you
  1 件のコメント
Bob Thompson
Bob Thompson 2018 年 10 月 15 日
編集済み: Bob Thompson 2018 年 10 月 15 日
This is very easy to do with indexing. There might be a fancier way than what I am about to suggest, but I would think to use a loop first.
for k = 1:size(A,3);
A(:,3,k) = k;
end
I think that will produce the result you're looking for, but if not then please feel free to explain more.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by