if逻辑判断。

2 visualizaciones (últimos 30 días)
javac
javac el 4 de Abr. de 2023
Respondida: mejong hehans el 4 de Abr. de 2023
求解,我先判断Z1和as1大小关系,然后在里面如何嵌套另一个逻辑判断;标红的地方
function Fy = fcn(N1,alpha1)
cf=1000;
Z1=tan(alpha1);
as1=atan(3*N1/cf);
for i=0:0.02:15
if abs(Z1)>=tan(as1)
Fy=-cf*Z1+cf^2*abs(Z1)*Z1/3*N1-cf^3*Z1^3/27*N1^2;
elseif as1>0
Fy=-N1*(-1);
elseif as1==0
Fy=0;
elseif as1<0
Fy=-N1;
end
end
end

Respuesta aceptada

mejong hehans
mejong hehans el 4 de Abr. de 2023
参考代码:
clear;clc
a = 6;
c = 11;
d = 10;
if a>3 & a<=5
    b=1;
elseif a>5 & a<=9
    if c == 10 & d == 10
        b = 2;
    else
        b = 1000;
    end
elseif a>9
    b = 3;
end
b

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by