How to enter 2 columns from an array into 1 input?
3 次查看(过去 30 天)
显示 更早的评论
Loaded in a set of data containing 3 columns of info.
column 1 is H (height) and 2 and 3 are measurements (say of R) where the x values are col 2 and y values are col 3.
i need to plot a graph where h is the horiz axis and R on the vertical axis.
how would i go about making essentially the x and y 1 axis so h can be the other?
0 个评论
回答(2 个)
Azzi Abdelmalek
2012-11-5
编辑:Azzi Abdelmalek
2012-11-5
[ax,h1,h2]=plotyy(h,x,h,y)
4 个评论
Azzi Abdelmalek
2012-11-5
do you mean
plotyy(h,x,h,y);
figure
plotyy(h,x1,h,y1)
figure
plotyy(h,x2,h,y2)
Walter Roberson
2012-11-6
I wonder if you want
plot(sqrt(x.^2 + y.^2), h);
2 个评论
Image Analyst
2012-11-6
But he wanted h on the horizontal axis and R on the vertical. I guess R = sqrt(x.^2 + y.^2). So wouldn't it be plot(h, sqrt(x.^2 + y.^2))?
Walter Roberson
2012-11-6
Right. I was reading off from the last line of the Question which implicitly used the other order.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!