フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I write code that multiplies one transition matrices by the different products of two matrixes?

1 回表示 (過去 30 日間)
ag..
ag.. 2019 年 4 月 5 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I am working on a problem where I need to multiply two matrices:
group1_transition*group1_distribution
I would like to multiply the product of this matrix by the group1_transition again, and then repeat this 4 more times. Each time I want to multiply the product of the multiplication by group1_transition again. In other words how can I simplify the following into simple code:
n = group1_transition*group1_distribution
x = n*group1_transition
b = x*group1_transition
k = b*group1_transition
g = k*group1_transition
  2 件のコメント
madhan ravi
madhan ravi 2019 年 4 月 5 日
Doesn’t your latter code work? If not why?
ag..
ag.. 2019 年 4 月 5 日
yes it does but I need a simpler way to code it

回答 (1 件)

A. Sawas
A. Sawas 2019 年 4 月 6 日
You can use the power ^ operator:
g = group1_transition*group1_distribution*(group1_transition^4);

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by