I am modelling an aircraft and I want to put limits on the throttles or aileron, and all the other powers. How do I connect u values to the limitation I created.

5 vues (au cours des 30 derniers jours)
u1min = -25*pi/180;
so these are the limits im trying to put in my throttles and aileron as i have 5 different variables for u values. So i want my answer of these connected to the answer i am getting for u1, u2, u3, u4, u5. These are the minimum and maximum values i am trying to input in u values. I am getting answer of u1, u2 as my u1 92*1double and all the rest but it is not getting connected to these limits.

Réponses (1)

Image Analyst
Image Analyst le 16 Mar 2022
If u1, u2, etc. are vectors and you want to clip them, you don't use if (unless you want to do it in a loop over all elements), you do it vectorized like
u1 = max([u1, u1min]);
u1 = min([u1, u1max]);
or alternatively
u1(u1 < u1min) = u1min;
u1(u1 > u1max) = u1max;
Then repeat for all the other u's.

Catégories

En savoir plus sur Physical Units dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by