how to write Loops in Functions?

4 ビュー (過去 30 日間)
Ahmed
Ahmed 2015 年 9 月 10 日
回答済み: Thorsten 2015 年 9 月 10 日
I have this Vector
Fx = [x(1)+2*x(2); x(1)+5*x(2)];
I want to take the first element of Fx_(x(1)+2*x(2))(also the second, third ,,,) and Put them instead of x(1),x(2),...
F=[x(1)+x(2); 3*x(1)-2*x(2)];

回答 (1 件)

Thorsten
Thorsten 2015 年 9 月 10 日
It is not entirely clear to me what you want to achieve.
If you want to use Fx instead of x, write
F=[Fx(1)+Fx(2); 3*Fx(1)-2*Fx(2)];

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by