I have issues calling Simulink in function. the function variable is called in Simulink file in a switch since switch compares a constant value there are errors running.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
function Sg = distance(value) %kts
%clc; clear all; close all
%sealevel
vrot = 0;
vrot = value;
Hwind=0.0;
Patm=101325 %Pa
Tatm=273; %K
Sref=11.9 %m2
b=8.85 %m
AR=6.57
mass=1120 %kg
n=1.0
WTO=mass*9.8 %N
CLa=4.4;
CD0=0.065
K100=1/pi/AR;
K0=1/CLa;
bhp=260 %hp
S=0.3; %suction factor
% K=S*K100+(1-S)*K0; %where S is a function of CL
K=0.11
mu =0.03
de=-10/57.3
CLde=0.18
CL0 = 0.5+CLde*de % flaps down0.5, flaps up 0.2
CLmax=CL0+CLa*12/57.3 % alpha max =16 for amber extinction; =12 for illumination of red
CLmin=CLa*4/57.3 % corresponding to alpha min of -4 deg
%vrot=10 %kts
Mach=[0 0.05 0.1 0.2 0.3]
Th0=400
Hm=1000/3.28
[den,a,Tatm,Patm,nu]=stdatmo(Hm,[]);
Th_at=Th0*(den/1.225-(1-den/1.225)/7.55)
Thrust=[1 0.95 0.9 0.85 0.8]*Th_at*9.8 % N
1 comentario
Benjamin Thompson
el 11 de Feb. de 2022
I do not see a call to Simulink here. Where is the error occurring in your code and what is the error message?
Respuestas (1)
Walter Roberson
el 11 de Feb. de 2022
The function is defined as returning the value of Sg, but Sg is not assigned to in the function.
0 comentarios
Ver también
Categorías
Más información sobre Simulink Environment Customization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!