Plotting certain values of a matrix
2 次查看(过去 30 天)
显示 更早的评论
Hello I have a 100x1 matrix and would like to plot n=2 and n=100 values against x how would I go about doing this? Thanks for any help
0 个评论
采纳的回答
madhan ravi
2019-3-17
plot(repmat(100,100,1),x)
% ^^^-—-—-n
hold on
plot(repmat(2,100,1),x)
9 个评论
madhan ravi
2019-3-17
编辑:madhan ravi
2019-3-17
'y' represents color of the plot which is yellow.
See my original answer after using hold on plot another line to the same figure
doc hold
doc plot
I suggest you to do MATLAB onramp course which is free and takes few hours to complete by then you will get know the basics of MATLAB.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!