How to multiply dimension matrix ???

Hi, I have matrix with dimension like below :
A = 220 x 1;
B = 220 x 11;
I want
C = 1 x 11
Im trying this code
C = bsxfun(@times,A,B);
the result is C = 220 x 1.
Is there possible I get result C = 1 x 11 ???
any help will be must appreciated. Thanks

2 件のコメント

Stephen23
Stephen23 2018 年 11 月 15 日
編集済み: Stephen23 2018 年 11 月 15 日
Oman Wisni
Oman Wisni 2018 年 11 月 15 日
Yes sir, thanks you for the answer

サインインしてコメントする。

 採用された回答

madhan ravi
madhan ravi 2018 年 11 月 15 日
編集済み: madhan ravi 2018 年 11 月 15 日

1 投票

clear all
A=rand(220,1)'; %AN EXAMPLE
B=rand(220,11);
A*B

8 件のコメント

Oman Wisni
Oman Wisni 2018 年 11 月 15 日
I get error using
size(A*B);
madhan ravi
madhan ravi 2018 年 11 月 15 日
Try my answer
Oman Wisni
Oman Wisni 2018 年 11 月 15 日
編集済み: madhan ravi 2018 年 11 月 15 日
I already trying sir. Get error like this
Error using *
Inner matrix dimensions must agree.
madhan ravi's reply: try clear all at the beginning and try my code , also see my comment below.
madhan ravi
madhan ravi 2018 年 11 月 15 日
>> A=rand(220,1)'; %AN EXAMPLE
B=rand(220,11);
size(A*B)
ans =
1 11
>>
Oman Wisni
Oman Wisni 2018 年 11 月 15 日
編集済み: madhan ravi 2018 年 11 月 15 日
but the value in matrix can't show
madhan ravi's reply: remove semicolon ; you will be able to see the output
Oman Wisni
Oman Wisni 2018 年 11 月 15 日
編集済み: madhan ravi 2018 年 11 月 15 日
if I remove semicolon, I get error sir,
Error using *
Inner matrix dimensions must agree.
madhan ravi's reply: see edited answer
Oman Wisni
Oman Wisni 2018 年 11 月 15 日
編集済み: madhan ravi 2018 年 11 月 15 日
this sir, the result like below I want in ans have value like matrix A and B.
ans = 1 x 11 double.
madhan ravi's reply: see edited answer , also be familiar with basic fundamentals
Oman Wisni
Oman Wisni 2018 年 11 月 15 日
編集済み: madhan ravi 2018 年 11 月 15 日
Yes sir, already. Thanks for you answer and your time
madhan ravi's reply: Anytime :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2018 年 11 月 15 日

コメント済み:

2018 年 11 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by