How do I plot specific values from a matrix
11 次查看(过去 30 天)
显示 更早的评论
I have 6 column 5000 row matrix: A
I would like to plot Column 1 against column 5.
e.g.
plot(A(:,1),A(:,5))
However I only want to do this when values from column 4 = 3.7 and the values from column 3 = 1.2
What is the easiest way to do this?
0 个评论
回答(1 个)
Matt Fig
2012-12-10
idx = A(:,4)==3.7 & A(:,2)==1.2;
plot(A(idx,1),A(idx,5))
Beware floating point issues!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!