[問題] 函數繪圖問題已回收

看板MATLAB作者 (K211)時間17年前 (2008/12/05 02:29), 編輯推噓4(407)
留言11則, 5人參與, 最新討論串1/1
我直接在 command windows 輸入 x=linspace(0,6*pi) y=9*sin(x)/x+cos(x); plot(x,y) 結果出來的圖是x對sin(x)的圖 如何才能跑出對的結果? 請各位大大幫忙 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.208.131

12/05 02:49, , 1F
就你的函數畫出來的 只是像sin(x), 但是振幅以及相位都不是
12/05 02:49, 1F

12/05 02:50, , 2F
hold on; plot(x,sin(x),'r-'); % 你會看到真正的sin(x)
12/05 02:50, 2F

12/05 03:02, , 3F
y=9*sin(x)./x+cos(x);
12/05 03:02, 3F

12/05 03:03, , 4F
我比較好奇sin(x)/x為什麼是純量...希望有大大能解惑
12/05 03:03, 4F

12/05 08:55, , 5F
原來要加個點 謝謝z大
12/05 08:55, 5F

12/05 09:23, , 6F
zzs 可能是這東西吧:If B is an m-by-n matrix with m ~= n
12/05 09:23, 6F

12/05 09:23, , 7F
and A is a column vector with m components, or a matrix
12/05 09:23, 7F

12/05 09:23, , 8F
with several such columns, then X = B/A is the solution
12/05 09:23, 8F

12/05 09:24, , 9F
in the least squares sense to the under- or
12/05 09:24, 9F

12/05 09:24, , 10F
overdetermined system of equations XA = B.
12/05 09:24, 10F

12/05 10:59, , 11F
這題看起來像是 kroning-penney model XD
12/05 10:59, 11F
文章代碼(AID): #19E25tOl (MATLAB)
文章代碼(AID): #19E25tOl (MATLAB)