フィルターのクリア

What does z(1) and z(2) mean in that context?

2 ビュー (過去 30 日間)
Srosch Ebrahimzada
Srosch Ebrahimzada 2019 年 12 月 11 日
コメント済み: Srosch Ebrahimzada 2019 年 12 月 11 日
Hi guys,
I'm new to Matlab and I really need your help. I have following code:
z1_dot = @(t,z) 1/(R*C)*[((B-1)*z(1)-z(2));((2*B-1)*z(1)-2*z(2))];
Can somebody explain me, what z(1) and z(2) mean and how do they corellate with the z in @(t,z) .
Thank you very much in advance.

採用された回答

Adam
Adam 2019 年 12 月 11 日
編集済み: Adam 2019 年 12 月 11 日
z(1) and z(2) mean the same as they would in any code - there is an expectation that z is an array with (at least) 2 values, otherwise it will error.
The z in @(t,z)
is what you must pass in to call that function, known as an anonymous function, which requires two input arguments, t and z, although since t appears to be un-used it is un-necessary. You would call it as e.g.
z1_dot( 7, [2 3] )
  1 件のコメント
Srosch Ebrahimzada
Srosch Ebrahimzada 2019 年 12 月 11 日
Wow, thank you Adam. You helped me a lot!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by