Plotting numbers of main diagonal

조회 수: 3 (최근 30일)
Feliciano Döring
Feliciano Döring 2018년 5월 23일
댓글: Feliciano Döring 2018년 5월 23일
I have a matrix that in the main diagonal has values that vary slightly from 1, almost an identity matrix. How would i plot a graph with all the data in a way that each row represents a of the matrix represents it's own line of values? For example, on the first row there is a one and the rest is zeros, so it would be a line with a peak on the one and the rest a straight line, the second row there is a row on the second row, second column so a peak there and so one forming one big graph showing all the peaks.

채택된 답변

Matt J
Matt J 2018년 5월 23일
surf(yourMatrix,'FaceColor','none');
  댓글 수: 3
Matt J
Matt J 2018년 5월 23일
You mean like
N=size(A,1);
for i=1:N
subplot(N,1,i);
plot(A(i,:))
end
Feliciano Döring
Feliciano Döring 2018년 5월 23일
Yes, thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by