2013-04-26 46 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