How to multiply 22x1 double with scalar?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi
I want to multiply like in the following code:
delta_x(i) = dx(i).*1.5;
type of dx is 22x1 double. 1.5 is scalar as you can see. When I do it like shown I get 22x1 double consisting of zeros. How do I have to multiply it, to get the right answer?
Thanks a lot
댓글 수: 1
채택된 답변
Torsten
2022년 4월 30일
If dx = 0 for all i, getting all zeros for delta_x is the right answer.
If you want to multiply delta_x by a scalar in a loop, use
delta_x(i ) = delta_x(i)*1.5;
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!