Plot of maximum value of chosen column in matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
clear close all clc
t = linspace(0,10,15); t = t'; rng default M = rand(15,5);
plot(t, M(:,1)); max_M = max(M); %maximum of each column max = max(max(M)); %total max
I would like to plot maximum value of first column of matrix M(:,1); and indicate this information on a plot.
Something like this:
댓글 수: 0
답변 (2개)
madhan ravi
2018년 10월 23일
편집: madhan ravi
2018년 10월 23일
t = linspace(0,10,15);
t = t';
rng default
M = rand(15,5);
plot(t, M(:,1));
hold on
m = M(:,1)
[P,K]=findpeaks(m)
plot(t(K(1)),P(1),'x')
hold off
댓글 수: 4
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
