How can I assign values to an equation?

1 回表示 (過去 30 日間)
Ede gerlderlands
Ede gerlderlands 2012 年 11 月 29 日
I have equation of the form
y(x)= gg.*M(x) / (k(x)-gg.L(x));
The thing is gg is number and varies with 'x' in such a way that
gg= 1, for x from 0 to 10
gg= 1.2, x=11
gg=1.6, x= 12
gg= 1.7, x= 13
How can I assign this values in matlab? am new to matlab
Thank you for your help
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 29 日
Are you working with a discrete function?
Ede gerlderlands
Ede gerlderlands 2012 年 11 月 29 日
It's continuous with x runs from 0 to 13.

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 29 日
From your question I guess you are using discrete function,
g=[ones(1,11) 1.2 1.6 1.12]
Because Matlab don't allow negative index, gg(0) is g(1), gg(1) is g(2) and so on

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by