Could anyone help me to display the non zero numbers with respect to each column
조회 수: 1 (최근 30일)
이전 댓글 표시
code:
C =[ 0 254.1128 0 ;
233.3050 0 0 ;
0 0 79.3894]
A=find(C~=0)
when i run the code it gives the following result
A = 2
4
9
It gives the place of the non zero numbers
Coud anyone help me how to get the place of non zero numbers with respect to each column in the following manner
A= 2 1 3
Could anyone please help me on this
댓글 수: 0
채택된 답변
Walter Roberson
2019년 6월 18일
[A,~] = find(C); %returns column vector
A = A.'; %make it into a row vector
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!