フィルターのクリア

Info

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

How can I create a matrix with the results of a disp function?

2 ビュー (過去 30 日間)
giorgos kazas
giorgos kazas 2020 年 2 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
J = [0 3 4;3 0 8;4 8 0];
for i =1:numel(J)
[i,j] = ind2sub(size(J),find(triu(J==i)));
disp([i j])
end
I have the above code and as a result I get 1 2 ; 1 3; 2 3, which are the positions of the elements 3,4 and 8 respectively. I want to get the position in decreasing order, that is firstly for the 8--> 2-3,next for the 4--> 1-3 and lastly 3--> 1-2.
How can I create a matrix M having the form of:
M=[8 2 3
4 1 3
3 1 2]
Thank you in advance.

回答 (0 件)

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

Community Treasure Hunt

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

Start Hunting!

Translated by