How do i plot the 3d profiles graph located below in matlab.
显示 更早的评论
I am looking to reproduce the graph below. I have the formula and I am using matlab. But I can only get an arc. I cannot get the graph to look like that. Thanks
采纳的回答
This should get you close to where you need to go
[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
h=figure;
ax=surf(X,Y,Z,'EdgeColor','none');
set(gca, 'Color', 'None')
set(gcf,'Color',[0 0 0])
box on
set(gca,'Ycolor',[1 1 1])
set(gca,'Xcolor',[1 1 1])
set(gca,'Zcolor',[1 1 1])
grid off
set(gca,'linewidth',1.2)
13 个评论
the thing is my formula is this [x,y]=meshgrid(-.002:.0005:.002, -.0006:.0002:.0006); m = .619211*x.^2; j = (53913.*x.^8.* + 2560.*x.^6).^1/2; l = j.*232.192; q = l - 53913.*x.^4; f = q.^1/3; n = m./f; g = (53913.*x.^8.^2 + 2560.*x.^6).^1/2; h = 232.192.*g; k = h - 53913.*x.^4.; b = .0011982.*(k).^1/3; z = f - b; surf(x,y,z);shading interp
and so it's not just like a regular figure. it came with a formula for which i had to solve for and then graph but my graph isn't coming out like theirs and they used the same formula
So the question isn't how to get your curve to look like the 3d figure but why is your curve not the same. and please edit using the code{} button so it is legible.
One thing i noticed is that your equations take no account for y. So that's one reason you only get arc. There is no y axis component in your equations therefore for all instances of y you'll get only variation in x.
how would i be able to fix that?
if true
% code
end
[x,y]=meshgrid(-.002:.0005:.002, -.0006:.0002:.0006);
m = .619211*x.^2;
j = (53913.*x.^8.* + 2560.*x.^6).^1/2;
l = j.*232.192;
q = l - 53913.*x.^4;
f = q.^1/3;
n = m./f;
g = (53913.*x.^8.^2 + 2560.*x.^6).^1/2;
h = 232.192.*g;
k = h - 53913.*x.^4.;
b = .0011982.*(k).^1/3;
z = f - b;
Very dumb question, but have you checked that you are using the same equations they are? Just from the code, I do not recognize what is being accomplished here and i only have your set to try to fit some y in there? Are all your units correct?
Here, i attached a blow up screen shot(the bottom pic) of what the equation that i am using is. so my x value is the radius(a), my y value is the pressure(p) and my z value is height(h). Pressure should be a constant right? but yesterday i rearranged it and included y in the equation as a variable and the top picture is what i got when solving for z. is it correct?
No attachment, also if your y axis is pressure which you say is a constant how would you expect there to be variations in the y axis?
here's the attachment
Okay well i would recheck your equations and get it to be a function of positional x,y, and z space as it looks like that is the axes the plots are in. If the equation turns out to be deflection and runout from the center you can get the runout from center as a function of x and y.
okay thank you, sorry i'm just an intern....
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
