How to add a single number to a 1*2401 matrix?

1 vue (au cours des 30 derniers jours)
Felix Hao
Felix Hao le 21 Avr 2020
Réponse apportée : KSSV le 21 Avr 2020
I'm trying to add my valu dragZeroLift = 0.0351 and my dragInduced matrix
Then the Matlab gives me erro like this:
Matrix dimensions must agree.
Error in dragCalc (line 4)
totalDrag = dragInduced + dragZeroLift;
Can you help me add 0.035 to each element in the dragInduced martix?
Thank you!
  2 commentaires
KALYAN ACHARJYA
KALYAN ACHARJYA le 21 Avr 2020
Please share whos
>> whos dragInduced
>>whos dragZeroLift
Felix Hao
Felix Hao le 21 Avr 2020
Sorry I don't know what whos is, But can you tell me how to do it? I just need to add 0.035 to every element in that matrix.
Thank You!!

Connectez-vous pour commenter.

Réponse acceptée

KSSV
KSSV le 21 Avr 2020
If A is array and k is constant.
iwant = A+k;

Plus de réponses (0)

Catégories

En savoir plus sur MRI dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by