Obtain an output in sequential multiplication using matlab

Hi all,
Can anyone help with proper codes in matlab to implement the program below:
% constants
n = 1;x=2;P=4;
Zc = 95;
Zo = 100;
% range of m to be computed for ZB
m = 0:10:800;
ZB = 1+((m)*sin(2*pi*n*x/P));
% Z1 for the range m = 0:10:800
Z1= abs(Zc*Zo*ZB);
% Sequential Z1 output multiplication
Zt = Z1*Z1*...*Zn % output from Z1 multiplied sequentially to the last one Zn
Hint: Z1... Zn are matrices

 採用された回答

Walter Roberson
Walter Roberson 2013 年 9 月 13 日

0 投票

You have not defined Z2 or Zn, only ZB, Z1, Zc and Zo. You never use ZB after defining it.
Meanwhile please read

2 件のコメント

Segun  Emmy
Segun Emmy 2013 年 9 月 13 日
Thanks Z2 is the second output answer ,Z3 is the third output answer upto the last output answer Zn i.e Z1*Z1*Z1*Z1...Zn.I just need codes to implement it correctly.
Segun  Emmy
Segun Emmy 2013 年 9 月 13 日
Thanks.The computer only computed for one Z1 output ignoring the rest outputs.I think there is need to include a code to reference all the Z1 outputs before using the product syntax or what do you think can solve this?

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

その他の回答 (1 件)

Roger Stafford
Roger Stafford 2013 年 9 月 13 日

0 投票

Use matlab's 'prod' function:
Zt = prod(Z1);

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by