Simulink, error while parsing Matlab function

1 次查看(过去 30 天)
Errors occurred during parsing of MATLAB function 'Subsystem1/MATLAB Function2'(#34)
This is the code in the Matlab function:
function [Thrust1,Torque1] = fcn(PWM_M)
Thrust3 = zeros;
Torque3 = zeros;
PWM = [1000 1200 1500 1600 1650 1700 1750 1800 1850 1900 1950 2000];
Frec_M = [0 50 75 84 91 94 100 109 113 119 121 125];
RPM_M = Frec_M * 60;
Thrust_all = 8.9e-7*RPM_M.^2.3314;
Torque_all = 1.0798e-005*Thrust;
Thrust1 = interp1(PWM,Thrust_all,PWM_M,'spline');
Torque1 = interp1(PWM,Torque_all,PWM_M,'spline');
end
  2 个评论
Mischa Kim
Mischa Kim 2014-4-11
What are the error msgs? Where is the variable Thrust declared or assigned?
Dragoș Vasile
Dragoș Vasile 2014-4-11
编辑:Azzi Abdelmalek 2014-4-11
This is the error:
Errors occurred during parsing of MATLAB function 'Subsystem1/MATLAB
Function1'(#18)
Errors occurred during parsing of MATLAB function 'Subsystem1/MATLAB
Function4'(#26)
Errors occurred during parsing of MATLAB function 'Subsystem1/MATLAB
Function2'(#34)
Errors occurred during parsing of MATLAB function 'Subsystem1/MATLAB
Function3'(#42)
Code Directory :
"D:\backup\cursuri, carti etc\anul 3\_proiect quadrocopter\matlab model\incercat de mine\slprj\_sfprj\Quadcopter\_self\sfun\src"
Machine (#17): "Quadcopter" Target : "sfun"
Chart "MATLAB Function1" (#18):
Chart "MATLAB Function4" (#26):
Chart "MATLAB Function2" (#34):
.
Chart "MATLAB Function3" (#42):
.
Code generation failed Errors occurred during parsing of MATLAB function 'Subsystem1/MATLAB
Function3'(#42)
Error using Parametri (line 50)
Errors occurred during parsing of MATLAB function 'Subsystem1/MATLAB
Function3'(#42)
---------------------------------------------------------------------
function [Thrust1,Torque1] = fcn(PWM_M)
Thrust1 = zeros;
Torque1 = zeros;
PWM = [1000 1200 1500 1600 1650 1700 1750 1800 1850 1900 1950 2000];
Frec_M = [0 50 75 84 91 94 100 109 113 119 121 125];
RPM_M = Frec_M * 60;
Thrust_all = 8.9e-7*RPM_M.^2.3314;
Torque_all = 1.0798e-005*Thrust_all;
Thrust1 = interp1(PWM,Thrust_all,PWM_M,'spline');
Torque1 = interp1(PWM,Torque_all,PWM_M,'spline');
end
----------------------------------------------------------------------
All 4 Matlab Function have the same code

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by