MATLAB Answers

how to get variable value in plot automatically

6 views (last 30 days)
Pallanti Srinivasa Rao
Pallanti Srinivasa Rao on 26 Aug 2019
Answered: KSSV on 26 Aug 2019
how to get a plot displaying value ofgain_resp.png gain and corresponding responce in single figure as shown in attached image

Answers (1)

KSSV
KSSV on 26 Aug 2019
x = 0:10 ;
figure
hold on
for i = 1:3
y = i*x ;
plot(x,y)
end
legend
OR
x = 0:10 ;
figure
hold on
for i = 1:3
y = i*x ;
plot(x,y)
str = ['k=',num2str(i)] ;
text(mean(x),mean(y),str)
end

  0 Comments

Sign in to comment.

Sign in to answer this question.

Products