Cell Array and Matrix Manipulation Help - Matlab Noob

3 ビュー (過去 30 日間)
Mark
Mark 2013 年 3 月 27 日
I have several 4x4 matrices stored in a cell array Kd2. I also have several 4x1 vectors stored in U_forcesd. How do I multiply the matrices by the vectors and return the result as I step through from 1 to the number of members I have previously established in my code? (The cell arrays are both member_countx1)
I was thinking something along these lines:
idx5 = 1:member_count
Kd2{idx5,1}*U_forcesd{idx5,1}
Each of these results as idx5 steps through would be a 4x1 vector. How do I store each one of these results? I don't really care if it is returned in one large vector or a matrix with each column being the result.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 27 日
編集済み: Azzi Abdelmalek 2013 年 3 月 27 日
out=cellfun(@(x,y) x*y,Kd2,U_forcesd,'un',0)
  1 件のコメント
Mark
Mark 2013 年 3 月 28 日
Thanks again Azzi. I'm thinking I need to take an online class or something. It's not sinking in with trial and error. :(

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by