Operations between matrix, different calculation according to conditions.
Afficher commentaires plus anciens
I want to multiply two matrices, but depends on conditions I will operate with other expression.
If we name matrices "A" and "B", column matrices, I want to multiply them. I have two operations which I will use according to conditions to proceed.
I tried with this code:
d = [64;
108;
454;
498;
542;
586];
As = [852;
568;
568;
568;
568;
852];
fs = [-344.4991;
-168.8422;
420.0000;
420.0000;
420.0000;
420.0000];
c = 150;
if d<c
Cs(:,1) = (fs-.85*21).*As/1000;
else
Cs(:,1) = (fs).*As/1000;
end
This results in a column matrix "Cs".
Réponse acceptée
Plus de réponses (1)
James Tursa
le 17 Avr 2018
Cs(:,1) = (fs-.85*21*(d<c)).*As/1000;
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!