[問題] fplot問題
最近念到function functions
課本舉了個例子是fplot
語法是 fplot(fun,lims)
這是他的例子
>> vel=@(t) sqrt(9.81*68.1/0.25)*tanh(sqrt(9.81*0.25/68.1)*t);
>> fplot(vel,[0 12])
成功跑出圖
接著我試著將fun換成自己寫的m檔,以這個例子
function v=vel(t)
v=sqrt(9.81*68.1/0.25)*tanh(sqrt(9.81*0.25/68.1)*t);
然後打
>> fplot(vel,[0 12])
卻說t沒定義,
請問若想把fun用自己寫的m檔換掉,該如何做呢?
還是fun只能是anonymous function??
我是搞錯哪裡了呢?
謝謝
~
--
" Regret doesn't remind us that we did badly,
It reminds that we know we can do better. "
--Kathryn Schulz
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.249.43
→
03/19 21:13, , 1F
03/19 21:13, 1F
→
03/19 21:17, , 2F
03/19 21:17, 2F