Borrar filtros
Borrar filtros

How to handle symbolic object in If loop to avoid 'ge' is not implemented for MuPAD symbolic objects."error

2 visualizaciones (últimos 30 días)
syms x4 x6 x8
Lm=1;
Ls=2;
Pref=1.0;
Isd=-(x6/Ls)+((Lm/Ls)*x8);
Pmeas=x4*Isd
% if (Pmeas>=Pref)
Kp=300;
% else
% Kp=0;
% end
Beta=Kp*(Pmeas-Pref);
x4=1;
x6=1;
x8=1;
op=eval(Beta)
....do something
But i am getting the error "Function 'ge' is not implemented for MuPAD symbolic objects." since x4 x6 x8 are symbolic Pmeas is also symbolic object.How to use symbolic object in if loop.Beacuse depending upon the comparison only Kp has to be fixed.
If i use if loop to compare Pmeas with Pref (Numeric comparison)it isshowing error, ge which is greater than (ge)Please help.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by