how to get variable value in plot automatically
2 次查看(过去 30 天)
显示 更早的评论
how to get a plot displaying value of gain and corresponding responce in single figure as shown in attached image
回答(1 个)
KSSV
2019-8-26
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!