2013-04-26 44 views
0

,所以我創建了一個功能MATLAB:功能未從腳本文件執行

function output = height (t)

output = (-9.8./2).*t.^2 + 125 *t + 500;

height (0:0.5:30)

我保存在那裏的保存在MATLAB的目錄中的文件,並

+0

這三行保存在一個文件中嗎?在這種情況下,最後一行將成爲函數的一部分。 – 2013-04-26 12:06:16

+3

什麼問題? – 2013-04-26 12:08:05

+0

@ Danil Asotsky感謝男人到底是什麼問題,爲其他人歡呼 – Nikolaj 2013-04-26 13:12:18

回答

1

試試這個,在一個文件中Editorsave和'run/launch':

function main() 

height(0:.1:30) 

end 


function out = height (t) 

out = (-9.8./2).*t.^2 + 125.*t + 500; 

end 
+0

歡呼聲! – Nikolaj 2013-04-26 13:37:27