Matlab 用计算机计算功率^

Matlab 用计算机计算功率^,matlab,function,graph,exponent,Matlab,Function,Graph,Exponent,我试图建立一个图表模型,如附图所示。我建模的方程也显示在图中 我的密码是 sigmafu=1660; phi=0.0:0.01:90; e=2.7183; %I searched on internet to find e value of Euler number and I %found this. %Dont know whether MATLAB bydefault has value of e, like MATLAB has value %pi. pw= (-0.3)*ph

我试图建立一个图表模型,如附图所示。我建模的方程也显示在图中

我的密码是

sigmafu=1660; 
phi=0.0:0.01:90;
e=2.7183; %I searched on internet to find e value of Euler number and I 
%found this. 
%Dont know whether MATLAB bydefault has value of e, like MATLAB has value 
%pi.
pw= (-0.3)*phi*(180/180);
F=sigmafu*(0)* 2.7183^(pw);
plot (phi,F)
通过使用上述编码,我得到以下错误:

使用^时出错。输入必须是标量和方阵。要计算元素级功率,请改用功率(.^)。
myeqsetlin中的错误(第126行):F=sigmafu*(0)*2.7183^(pw)


有人能帮我更正代码吗?另外,MATLAB是否有默认值e(欧拉数),如果有,我如何使用它?

您可以使用exp(1)获得e的值。意思是e^1

sigmafu = 1660; 
phi = 0.0:0.01:90;
pw = -0.3*phi*pi/180;
F = sigmafu*exp(pw);
plot(phi,F)

如果我使用,^而不是^I,则图形中可能会出现重复。我在0处得到一条直线。它仍然不能解决让你惊讶的问题?你乘(0),你期望什么?哦,乘(180/180)对你的代码没有多大贡献。你想乘以(π/180)。从度到弧度的转换。
exp(1)。^pw
应写成
exp(pw)
()。