Plot animation of multivariable function

Hi,I am new to matlab and I am trying to plot a animation of Rosenbrock Function when x3 is changing just like this from wikipedia.Can someone tell me how to get start?

2 件のコメント

Jacob Wood
Jacob Wood 2020 年 2 月 20 日
Do you have code to create the plot?

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

回答 (1 件)

Devineni Aslesha
Devineni Aslesha 2020 年 2 月 25 日

0 投票

I considered a random function to plot the animation of a multivariable function.
x = linspace(-2,2);
y = linspace(-2,2);
z = linspace(-2,2);
[X,Y,Z] = ndgrid(x,y,z) ;
for i = 1:100
fxyzOut(:,:,i) = randFun(X(:,:,i),Y(:,:,i),Z(:,:,i));
surf(X(:,:,i),Y(:,:,i),fxyzOut(:,:,i)/1000) ;
drawnow
pause(0.05)
end
function fxyz = randFun(x,y,z)
fxyz =((1-x).^2)+(100*((y-(x.^2)).^2)) + ((1-z).^2)+(100*((y-(z.^2)).^2));
end
For more information, refer the following links:

カテゴリ

ヘルプ センター および File ExchangeAnimation についてさらに検索

製品

リリース

R2019b

質問済み:

2020 年 2 月 20 日

回答済み:

2020 年 2 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by