how to multiply matrix vectors with one column?

if i have matrix M = [1 0 1 0; 1 0 0 1;1 1 1 0;1 1 1 1; ...] and i want to multiply each row with one cloumn B=[1 0 0 1] how to do this?

 採用された回答

Mohammad Abouali
Mohammad Abouali 2014 年 11 月 9 日

0 投票

M*B'

3 件のコメント

sara
sara 2014 年 11 月 9 日
If i want to multiply this answer(say its C) with the same matrix M (C1=C*M), then multiply the new answer (say its C1) with M (C2=C1*M) and so on for many times until one answer is repeated.then the code stop and save the results in a form of matrix. how to do this?
Mohammad Abouali
Mohammad Abouali 2014 年 11 月 9 日
編集済み: Mohammad Abouali 2014 年 11 月 9 日
B' is 4x1 M is 4x4 then C=M*B' would be also 4x1. then you can not compute C*M since C is 4x1 and M is 4x4.
But you can compute C1=M*C and then C2=M*C1. Exactly as we are writing this.
sara
sara 2014 年 11 月 9 日
編集済み: sara 2014 年 11 月 9 日
that what i meant....C1=M*C and then C2=M*C1. and so on until one answer is repeated. i try to use for loop but it didn't work

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSparse Matrices についてさらに検索

タグ

質問済み:

2014 年 11 月 9 日

編集済み:

2014 年 11 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by