[問題] 基本的繪圖問題已回收
close all; x=linspace(1, 100, 100); % 100個點的x座標
y=1/x; % 對應的y座標
plot(x,y);
這樣會跑出錯誤 :
??? Error using ==> mrdivide
Matrix dimensions must agree.
close all; x=linspace(1, 100, 100); % 100個點的x座標
y=x^2; % 對應的y座標
plot(x,y);
??? Error using ==> mpower
Matrix must be square.
close all; x=linspace(1, 100, 100); % 100個點的x座標
y=3*x; % 對應的y座標
plot(x,y);
正確!
close all; x=linspace(1, 100, 100); % 100個點的x座標
y=x*x; % 對應的y座標
plot(x,y);
??? Error using ==> mtimes
Inner matrix dimensions must agree.
________________________________________
請問以上是為什麼?
為什麼有時能畫有時不能?
謝謝各位大大的解答~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.115.227.110
※ 編輯: huiyula 來自: 59.115.227.110 (11/20 14:58)
→
11/20 15:02, , 1F
11/20 15:02, 1F
討論串 (同標題文章)
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章