[問題] 用@輸入函數(solved

看板MATLAB作者 (空號)時間12年前 (2012/01/05 14:45), 編輯推噓1(103)
留言4則, 2人參與, 最新討論串1/1
單變數 f=@(x)x.^2+x+1; 多變數 f=@(x,y,z)x^2+x+1+y^2+y+z; 三角函數 f=@(x,y,z)x^2+sin(y)+cos(z); 指數函數 f=@(t)=5*exp(t); but f=@(t)=exp(5*t) or f=@(t)=5*exp(t)^5 fail f=@(t,y)=5*exp(t)^5+y fail Error: The expression to the left of the equals sign is not a valid target for an assignment. then how to match exponential function? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.89.169

01/05 16:50, , 1F
去掉等號 ?
01/05 16:50, 1F

01/05 16:50, , 2F
f=@(t,y)5*exp(t)^5+y 可以嗎?
01/05 16:50, 2F

01/05 18:50, , 3F
stupid i :( . copy and paste let me forget '='
01/05 18:50, 3F

01/05 18:51, , 4F
thank you
01/05 18:51, 4F
文章代碼(AID): #1F1KRry2 (MATLAB)