how to write mathematical equation in matlab script (given in description)?

2 ビュー (過去 30 日間)
Yogesh Kumar
Yogesh Kumar 2022 年 3 月 9 日
コメント済み: Walter Roberson 2022 年 3 月 10 日
programming in matlab
  4 件のコメント
Torsten
Torsten 2022 年 3 月 10 日
編集済み: Torsten 2022 年 3 月 10 日
In your workspace, h is listed as a function handle. You can call this function handle as h(i,j) and it will return a double evaluated at theta=i and z=j, but you cannot set this value to another double value, namely ((1+E*cos(theta(i)))...
What you could do in the loop is to write
H(i,j) = h(theta(i),z(i));
instead of
h(i,j) = ((1+E*cos(theta(i)))...
and continue working with the array H consisting of doubles.
Walter Roberson
Walter Roberson 2022 年 3 月 10 日
Note that MATLAB uses period for decimal. X=0.0 not X=0,0

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

回答 (0 件)

カテゴリ

Help Center および 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