matlab代码错误x=1:0.001:3;>> y=qjf(x);plot(x,y)Error using ^ Inputs must be a scalar and a square matrix.To compute elementwise POWER,use POWER (.^) instead.Error in qjf (line 5)y=(1+( 29/450 - 6^(1/2)/75)*(x-( 6^(1/2)/30 - 1/45))^(-2))^(-1)定
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 04:11:46
matlab代码错误x=1:0.001:3;>> y=qjf(x);plot(x,y)Error using ^ Inputs must be a scalar and a square matrix.To compute elementwise POWER,use POWER (.^) instead.Error in qjf (line 5)y=(1+( 29/450 - 6^(1/2)/75)*(x-( 6^(1/2)/30 - 1/45))^(-2))^(-1)定
matlab代码错误
x=1:0.001:3;
>> y=qjf(x);plot(x,y)
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER,use POWER (.^) instead.
Error in qjf (line 5)
y=(1+( 29/450 - 6^(1/2)/75)*(x-( 6^(1/2)/30 - 1/45))^(-2))^(-1)
定义函数:
function [ y] = qjf( x)
if x>5/4
y = 0.16021679021734536863489233293057*ln(x)+0.76424865645073781412555427756929
else
y=(1+( 29/450 - 6^(1/2)/75)*(x-( 6^(1/2)/30 - 1/45))^(-2))^(-1)
end
matlab代码错误x=1:0.001:3;>> y=qjf(x);plot(x,y)Error using ^ Inputs must be a scalar and a square matrix.To compute elementwise POWER,use POWER (.^) instead.Error in qjf (line 5)y=(1+( 29/450 - 6^(1/2)/75)*(x-( 6^(1/2)/30 - 1/45))^(-2))^(-1)定
^ 是矩阵求幂
.^ 是元素求幂,或者矩阵震中的元素求幂