作者adidasmlbnba (酒鬼鬼)
看板MATLAB
标题[讨论] 方程式错误问题
时间Mon Mar 26 13:30:03 2012
大家好
小弟我刚接触matlab不久
今天使用时出现点小问题
function y=func(x)
if x>=9
y=15*sqrt(4*x)+10
elseif x>=0
y=10*x+10
else
y=10
end
??? function y=func(x)
|
Error: Function definitions are not permitted in this context.
请问一下 是错误在哪个地方?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.46.205.90
1F:推 sanzosaskura:先存成.m档 再用function的形式呼叫进来执行 03/26 14:32
2F:→ mp19990920:你的code是C的写法,matlab函数的输入最好是matrix型式 03/26 17:43