フィルターのクリア

Morph a graph into another graph?

2 ビュー (過去 30 日間)
Jovos
Jovos 2016 年 3 月 19 日
回答済み: Star Strider 2016 年 3 月 19 日
Hi, I got a question asking me to smoothly morph the graph of y = x^2 + y^2 into a graph of y = -x^2 + y^2 and back again. I used the function morph but it does not work. I wonder is there any other functions/syntax to this? Any information is helpful. Thanks.

回答 (1 件)

Star Strider
Star Strider 2016 年 3 月 19 日
One approach:
[X,Y] = meshgrid(linspace(-5, 5, 50));
fcn = @(x,y,k) k*x.^2 + y.^2;
v = [1:-0.05:-1; -1:0.05:1];
for k1 = 1:2
for k2 = v(k1,:)
surf(X, Y, fcn(X,Y,k2))
axis([-5 5 -5 5 -40 60])
drawnow
pause(0.1)
end
end

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by