How to change a variable within an equation in a loop?

1 回表示 (過去 30 日間)
Matthew
Matthew 2012 年 11 月 14 日
I have 48 different values in F. I would then have s=[ 1 0 -1 F(1)] for instance but I want to be able to use it in a loop where it will automatically go through all the different values of F e.g. F(1), F(2) ect.
I would then save the answers as p(i)=roots(s) where i is i=1:1:48
Any help is greatly appreciated.

採用された回答

Jürgen
Jürgen 2012 年 11 月 14 日
do you mean
for Counter=1: 48 s=[ 1 0 -1 F(i)] p(i)=roots(s) end
probably I misunderstood becaus ethis seems to simple
regards

その他の回答 (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