mutiplying vector of different size?
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
here is what i got
a=linspace(1,1,4); b=linspace(1,1,20);
when i try c=a*b i get a error message saying " ??? Error using ==>mtimes Inner matrix dimensions must agree."
I know this is because a is 4 columns while b has 20 columns, but I don't know how else to define a and b to allow them to multiply. I am trying to find all possible values of c
댓글 수: 0
답변 (2개)
bym
2011년 11월 27일
is this what you want?
a =
1 2 3 4
b =
Columns 1 through 14
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Columns 15 through 20
15 16 17 18 19 20
>> a.'*b
ans =
Columns 1 through 14
1 2 3 4 5 6 7 8 9 10 11 12 13 14
2 4 6 8 10 12 14 16 18 20 22 24 26 28
3 6 9 12 15 18 21 24 27 30 33 36 39 42
4 8 12 16 20 24 28 32 36 40 44 48 52 56
Columns 15 through 20
15 16 17 18 19 20
30 32 34 36 38 40
45 48 51 54 57 60
60 64 68 72 76 80
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!