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

조회 수: 3 (최근 30일)
Felix Hao
Felix Hao 2020년 4월 21일
답변: KSSV 2020년 4월 21일
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
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 4월 21일
Please share whos
>> whos dragInduced
>>whos dragZeroLift
Felix Hao
Felix Hao 2020년 4월 21일
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!!

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2020년 4월 21일
If A is array and k is constant.
iwant = A+k;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by