필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

i want to write a n*n matrix into single column

조회 수: 1 (최근 30일)
SANJOY MONDAL
SANJOY MONDAL 2017년 12월 23일
마감: MATLAB Answer Bot 2021년 8월 20일
i have a matrix of n * n i want to arrange the same matrix in a single column with index like this
[2.3 3.5 4.5;
1.3 3.9 2.8;
3.6 5.9 2.7]
i want to see like this
1 1 2.3;
1 2 3.5;
1 3 4.5;
...

답변 (1개)

Walter Roberson
Walter Roberson 2017년 12월 23일
[I, J] = ndgrid(1:size(TheMatrix,1), 1:size(TheMatrix,2));
[J(:), I(:), reshape(TheMatrix.',[],1)]

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by