Rotating a Trig function using meshgrid

1 回表示 (過去 30 日間)
Dan Lynn
Dan Lynn 2015 年 11 月 19 日
回答済み: Star Strider 2015 年 11 月 19 日
I created a minimum x point and a maximum x point as well as a radius. I need to rotate a sin(x) function around the x-axis with it being within the minimum and maximum x location points. The sine wave should also be amplified by the radius. How can I use meshgrid to make the xx, yy, and zz coordinates for the sine wave rotation?

採用された回答

Star Strider
Star Strider 2015 年 11 月 19 日
It’s difficult to understand what you did from your description.
See if this works:
f = @(x,y) sin(hypot(x,y)).*hypot(x,y);
x = linspace(-5*pi, 5*pi, 100);
[X,Y] = meshgrid(x);
Z = f(X,Y);
figure(1)
surfc(X, Y, Z)
grid on

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by