function [t1,t2,t3,t4] = f(N,U,theta)
% This block supports an embeddable subset of the MATLAB language.
% See the help menu for details.
Ts=1/2e4;%Carrier Cycle.
Udc=100;
t11=U*cos(theta);
t22=U*sin(theta);
switch(N)
case 1
if t11+t22>Ts
{t1=Ts*t11/(t11+t22);t2=Ts*t22/(t11+t22);t3=0;t4=0;}
else
{t1=((Ts*cos(theta))/(2*sqrt(2)*Udc))*(sqrt(2)*Udc/(sin(theta)+cos(theta))+U);
t2=((Ts*sin(theta))/(2*sqrt(2)*Udc))*(sqrt(2)*Udc/(sin(theta)+cos(theta))+U);
t3=((Ts*cos(theta))/(2*sqrt(2)*Udc))*(sqrt(2)*Udc/(sin(theta)+cos(theta))-U);
t4=((Ts*sin(theta))/(2*sqrt(2)*Udc))*(sqrt(2)*Udc/(sin(theta)+cos(theta))-U);}
end
break;
运行是出错如下:
Parse: The expression to the left of the equals sign is not a valid target for an assignment.
Function 'Turn-on Time' (#18.262.263), line 11, column 12:
"="