Simulink, error while parsing Matlab function

1 visualizzazione (ultimi 30 giorni)
Dragoș Vasile
Dragoș Vasile il 11 Apr 2014
Modificato: Azzi Abdelmalek il 11 Apr 2014
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 Commenti
Mischa Kim
Mischa Kim il 11 Apr 2014
What are the error msgs? Where is the variable Thrust declared or assigned?
Dragoș Vasile
Dragoș Vasile il 11 Apr 2014
Modificato: Azzi Abdelmalek il 11 Apr 2014
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

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by