Summation using For Loop

1 回表示 (過去 30 日間)
J.Cam
J.Cam 2021 年 5 月 10 日
コメント済み: Brian Voke 2021 年 5 月 10 日
I have to solve the equation for 'a'.
Now x are the elements in the following array:
x=[0.56746089 0.60481729 0.622521 0.53714241 0.60310756 1.07806689 1.19968209 1.05637284 1.14618436 0.94031809];
My problem is that I do not know how to call the elements in the array in a function.

採用された回答

Brian Voke
Brian Voke 2021 年 5 月 10 日
To call a specific element from an array or matrix you can use this notation: for matrix x the first element would be x(1), the second element would be x(2) and so on. If you're just trying to find the solution to that equation where each element in a corresponds to a solution with a single element in x then you can write the equation using element wise operators to multiply matrices element wise the operator is preceded with period. (So a times x would be written as a .*x). Then you could solve the equation using the solve function.
  6 件のコメント
J.Cam
J.Cam 2021 年 5 月 10 日
This worked! Thank you!
Brian Voke
Brian Voke 2021 年 5 月 10 日
No problemo

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by