[問題] 基本的繪圖問題已回收

看板MATLAB作者 ( )時間17年前 (2008/11/20 14:57), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/2 (看更多)
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
y=1./x; y=x.^2;
11/20 15:02, 1F
文章代碼(AID): #199GfV6u (MATLAB)
文章代碼(AID): #199GfV6u (MATLAB)