我有这个行/列向量。
grades = [90, 100, 80, 70, 75, 88, 98, 78, 86, 95, 100, 92, 29, 50];
plot(grades);
在MATLAB中,我希望沿着x轴绘制等级值,沿着y轴绘制指数(1-14) .根据耳聋,指数沿x轴作图.如何实现这一目标?
发布于 2015-08-23 13:33:25
grades = [90, 100, 80, 70, 75, 88, 98, 78, 86, 95, 100, 92, 29, 50];
figure;
plot(1:length(grades),grades); % Indices along X
figure;
plot(grades,1:length(grades)); % Indices along Y
发布于 2015-08-23 13:51:21
如果你想在Matlab中绘制数据。您必须为您感兴趣的所有轴定义数据集。
在这种情况下,定义x轴数据和y轴数据.
例如,您的Y轴数据将是
grades = [90 100 80 70 75 88 98 78 86 95 100 92 29 50];
对于x数据,可以使用以下内容。
X = 1:14;
然后,您将得到以下绘图命令:
plot(x,grades)
https://stackoverflow.com/questions/32167175
复制相似问题