matrix dividing

If I have a big matrix like this: A=ones(1,450000). How can I divide it in 300 equal parts (1, 1500) and multiple these 300 parts (arrays) with a matrix with dimensions B=(1,300)?
Thank you...

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2011 年 11 月 15 日

0 投票

A=ones(1,450000);
NewA=reshape(A,300,[]);
C=B*NewA;

2 件のコメント

athpapa -
athpapa - 2011 年 11 月 15 日
with the reshape that you told me, I want now to multiple the first column of array B with the first only line of array NewA, and so on...the 2nd column of array B with the 2nd only line of NewA. Do you know how can I do this??
Thankssssss
Fangjun Jiang
Fangjun Jiang 2011 年 11 月 15 日
Use this example to understand the row and column
Assume B=magic(3)
B(:,1) is the first column of B, B(:,2) is the second column,...
B(1,:) is the first row of B, B(2,:) is the second row, ...

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

カテゴリ

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

タグ

質問済み:

2011 年 11 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by