[問題] 自訂function無法成功的問題已回收

看板MATLAB作者 (jon)時間15年前 (2010/09/26 15:38), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/3 (看更多)
根據數值分析課本 Applied Numerical Methods 3章中提到 M-file & function -------------------------------------------------------------- 我先存好一個 money.m 內容: p=100000; i=0.06; n=[1:7]; f=p*(1+i).^n 在command window中 輸入 money f = 1.0e+005 * 1.0600 1.1236 1.1910 1.2625 1.3382 1.4185 1.5036 但是想執行 function f = money(p, i, n); 卻出現 Error: Function definitions are not permitted at the prompt or in scripts. 無法繼續下去 求各位指點 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.37.68.212
文章代碼(AID): #1CdlXwfF (MATLAB)
文章代碼(AID): #1CdlXwfF (MATLAB)