Cannot do example multiply
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
tried using the example for .* Why am I getting an error?
>> a = [1 2 3]
a =
1 2 3
>> b = (1:6)'
b =
1
2
3
4
5
6
>> a.*b
Error using .*
Matrix dimensions must agree.
댓글 수: 0
답변 (2개)
Jos (10584)
2017년 10월 26일
0 개 추천
a .* b returns a vector c where c(1) = a(1) * b(1), c(2) = a(2) * b(2), etc. but in your example you run out of values of a. For this to work, a and b have to have the same number of elements!
댓글 수: 0
Steven Lord
2017년 10월 26일
0 개 추천
This message from the Related Content section on the right side of this page is relevant. You're using a release prior to release R2016b, right? See also this post on Loren's blog.
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!