whats the problem in error 11
2 ビュー (過去 30 日間)
古いコメントを表示
clc
clear all
s=[0 0.2 0.4 0.6 0.8 1];
y=[0 0.74 0.96 0.98 0.81 0];
x=[0 0.63 0.77 0.86 0.93 1];
t=[ 3.12 1.91 1.43 1.17 1];
m=[ 1.70 1.22 0.88 0.57 0];
yyaxis left
plot(s,y,':bo',s,x,':ro');
yyaxis right
plot(s,t,':go',s,m,':yo');
0 件のコメント
回答 (1 件)
Walter Roberson
2023 年 9 月 8 日
Your t and m have fewer elements than your s, so you cannot plot t against s or m against s. You could plot t against m
2 件のコメント
Walter Roberson
2023 年 9 月 8 日
guessing
s=[0 0.2 0.4 0.6 0.8 1];
y=[0 0.74 0.96 0.98 0.81 0];
x=[0 0.63 0.77 0.86 0.93 1];
t=[ 3.12 1.91 1.43 1.17 1];
m=[ 1.70 1.22 0.88 0.57 0];
yyaxis left
plot(s,y,':bo',s,x,':ro');
yyaxis right
smid = (s(1:end-1)+s(2:end))/2;
plot(smid, t, ':go', smid, m, ':mo');
Les Beckham
2023 年 9 月 8 日
Here's another guess
clc
clear all
s=[0 0.2 0.4 0.6 0.8 1];
y=[0 0.74 0.96 0.98 0.81 0];
x=[0 0.63 0.77 0.86 0.93 1];
% t=[ 3.12 1.91 1.43 1.17 1];
% m=[ 1.70 1.22 0.88 0.57 0];
t=[0 3.12 1.91 1.43 1.17 1]; % << added a datapoint at zero
m=[0 1.70 1.22 0.88 0.57 0]; % << added a datapoint at zero
yyaxis left
plot(s,y,':bo',s,x,':ro');
yyaxis right
plot(s,t,':go',s,m,':yo');
grid on
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!