[繪圖] 方程式繪圖已回收

看板MATLAB作者 (對愛絕望)時間14年前 (2011/10/08 17:59), 編輯推噓3(304)
留言7則, 4人參與, 最新討論串1/1
不好意思~想對 y=log(4.5*exp(-x)*cos(2*pi*x)) 畫圖 範圍是在x=1~2 對繪圖不是\很會 希望給個參考~謝謝 >"< -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.39.139.227

10/08 17:59, , 1F
y是-2~2
10/08 17:59, 1F

10/08 18:04, , 2F
linspace; plot; 爬文一堆
10/08 18:04, 2F

10/08 18:49, , 3F
查help阿 還有範例讓你看咧
10/08 18:49, 3F
有爬過了 我打 >>x=linspace(1,2,100); >>y=log(4.5*exp(-x)*cos(2*pi*x)) 出現??? Error using ==> mtimes Inner matrix dimensions must agree. >>plot(y,x,'-') 出現??? Undefined function or variable 'y'. 所以不知道要怎麼畫.. ※ 編輯: roud 來自: 114.39.139.227 (10/08 19:45) ※ 編輯: roud 來自: 114.39.139.227 (10/08 19:45)

10/08 19:48, , 4F
>>y=log(4.5*exp(-x).*cos(2*pi*x));
10/08 19:48, 4F

10/08 19:49, , 5F
>>plot(x,y)
10/08 19:49, 5F

10/08 19:50, , 6F
感謝 原來要用點 不過都不太知道用點的位置
10/08 19:50, 6F

10/09 23:01, , 7F
這很基本的喔
10/09 23:01, 7F
文章代碼(AID): #1Ea1xh6H (MATLAB)