How to rotate a parabula vector around its max vale

1 view (last 30 days)
Hello,
I am fighting this task for some days now with no solution ye, so maybe someone will be able to shade some light...
I have a 1D vector which when plotted is forming an asimmetric parabula. I would like to rotate this vector around its max value (peak), creating a 2D matrix so a bell shape will be created ( like rotating it around the Y axis)
Any ideas how to do this?
Thanks a lot!
Tomer Braier

Answers (1)

Star Strider
Star Strider on 20 Nov 2014
I don’t know what you mean by an ‘asymmetric parabola’. I thought parabolas were by definition symmetric about some axis.
This works with a parabola symmetric about zero:
px = @(x) 5 - 3.*x.^2; % Parabola As Function Of ‘x’
py = @(y) sqrt((5-y)./3); % Express Parabola As Function Of ‘y’
x = linspace(0,5,50); % Set To Avoid Complex Values, So Must Be <=5 Here
P = py(x); % Evaluate Parabola In ‘y’
[X,Y,Z] = cylinder(P); % Use ‘P’ To Define Cylinder Profile
figure(1)
surf(X,Y,Z) % Plot Parabola
You will probably have to experiment with it to get the result you want. This is simply one way to do it.
  2 Comments
Tomerbr braier
Tomerbr braier on 20 Nov 2014
Thanks Star for your detailed answer. I'm afraid I might explained the problem in a wrong way, thought. I have a vector of numbers, 1D. It is forming a parabulic shape around its max value. I don't know the exect formula which describe the parabula. I want to be able to rotate or maybe better put, revolve, the vector around its max value to obtain 2D matrix.
Do you think I still be able to do it using "cylinder"?
Thanks in advance,
Tomer
Star Strider
Star Strider on 20 Nov 2014
Edited: Star Strider on 20 Nov 2014
My pleasure!
You may be able to, depending on your data. It needs to be close to symmetric about some value to do what you want. I would have to make it symmetric and use half of it.
If you have your vector in a file, upload it here (use the ‘paperclip’ or ‘staple’ icon) and I’ll do my best to make it work with cylinder.
I didn’t know if you had data or a function so I didn’t know exactly how to proceed.

Sign in to comment.

Categories

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

Community Treasure Hunt

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

Start Hunting!