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

 Accepted Answer

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 Comments

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?
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....

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 22 Jul 2014

Commented:

on 23 Jul 2014

Community Treasure Hunt

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

Start Hunting!