matlab中function和end问题,错误提示This statement is not inside any f
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/05 19:30:18
matlab中function和end问题,错误提示This statement is not inside any function.(6行代码)
function RC = reflect_coeff( ZL,Z0,f )
RC = 0.5*abs(ZL-Z0)/sqrt(ZL*Z0)*abs(cos(f*pi/2));
end
x=0:0.1:5;
a=reflect_coeff(100,50,x);
plot(x,a,'b-')
------------------------------------------------------------------------
>> micro_a
Error:File:micro_a.m Line:5 Column:1
This statement is not inside any function.
(It follows the END that terminates the definition of the function
"reflect_coeff".)
function RC = reflect_coeff( ZL,Z0,f )
RC = 0.5*abs(ZL-Z0)/sqrt(ZL*Z0)*abs(cos(f*pi/2));
end
x=0:0.1:5;
a=reflect_coeff(100,50,x);
plot(x,a,'b-')
------------------------------------------------------------------------
>> micro_a
Error:File:micro_a.m Line:5 Column:1
This statement is not inside any function.
(It follows the END that terminates the definition of the function
"reflect_coeff".)
可以单独保存1-3行代码后在命令行中运行5-7行代码或改为
function reflect_coeff
x=0:0.1:5;
a=reflect_coeff1(100,50,x);
plot(x,a,'b-')
function RC = reflect_coeff1( ZL,Z0,f )
RC = 0.5*abs(ZL-Z0)/sqrt(ZL*Z0)*abs(cos(f*pi/2));
function reflect_coeff
x=0:0.1:5;
a=reflect_coeff1(100,50,x);
plot(x,a,'b-')
function RC = reflect_coeff1( ZL,Z0,f )
RC = 0.5*abs(ZL-Z0)/sqrt(ZL*Z0)*abs(cos(f*pi/2));
matlab中function和end问题,错误提示This statement is not inside any f
This statement is not inside any function.
matlab:出现错误Function definitions are not permitted in this co
matlab中end问题
Matlab里大于号怎么用?为什么出现错误Function '>' is not defined for values
Matlab积分问题?Function 'eval' is not defined for values of clas
关于matlab中function的问题!
what is the end behavior of this polynomial function,sketch
matlab:Error:Function definitions are not permitted in this
MATLAB function的问题- -
matlab中function定义函数,出现自变量未定义错误,是怎么回事?
matlab中我运行m文件总是提示File F:\matlab2\work\1.m is not found in th