【发布时间】:2015-02-20 17:07:35
【问题描述】:
我有以下代码。我正在尝试使用两个 y 轴创建一个 xy 图。但是我只在中间得到一条线。我希望 y 是右侧的垂直轴,而 vel 是左侧的垂直轴。我有几组不同位置的数据,我试图将第一组放在 x 轴上的 0.66,第二组放在 1 等,但我无法让它工作。请帮忙。
问候, 耶
clc
clear
%Retrieve data and figure setup
filename = 'G:\Protable Hard Drive\PHD Hard Drive\Experimental Data\Bulkrename Trial\Common data for line graphs\Data for line graphs.xls';
a = xlsread(filename, 'Veldef');
vel = 0:1/37:1;
y = -16/15:1/15:21/15;
%X/D=0.66 TSR5
x = 0.66;
exp = a(1:38,2);
ko = a(1:38,4);
rst = a(1:38,6);
%Plot
h = plot(x,exp,x,ko,x,rst);
【问题讨论】: