Moving a point along a curve in matlab [duplicate] - matlab

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Points moving along a curve within MATLAB
I have two arrays ,the first represents the x-axis values and the second represents the y-axis values of a certain curve. I want to draw a point (or some object) that moves along that curve in MATLAB.

You can just trace the curve, i.e., you can place the cyrsor on the curve and press left or right to move your cursor across it.

Related

Area under surface between two curves [duplicate]

This question already has an answer here:
Area between line and curve (no function)
(1 answer)
Closed 6 years ago.
I want to determine the area between the red line and the blue line but only to the y-value of 4.559. How can I achieve that?
In general:
First you have to subtract the two functions from each other. After
that, you have a function that represents the delta in y for each
point on the x-axis.
After that you have to calculate the integral, for matlab you should look here Matlab - Numerical Integral
The last step is inserting the left, and the right bound of your desired area to calculate. The result is the area under the surface
Be careful when subtracting the functions, the result of the area might be negative (negate it in this case) if the "bigger" function is the subtrahend

how to create 3d cylinder matlab [duplicate]

This question already has answers here:
Cylinder with filled top and bottom in matlab
(2 answers)
Closed 7 years ago.
I am trying to create a filled 3d shape that will look similar to this: (long round object)
(no need for the round part at the top, one color for all the object is good)
I've tried to create many similar circles with different center point but it didn't work, and with cylinder all I got was weird shapes.
To make a cylinder the exact name exists as a command:
figure;
cylinder(0.1,20);
axis equal;

Making points transparents [duplicate]

This question already has answers here:
Plot circles with alpha values in MATLAB
(5 answers)
Closed 8 years ago.
I have a plot similar to the one below. This is a cylindar. The points near the axis are red and become more and more blue when they get far from it.
The problem is that the blue points completely hide the red ones.
Is there any way to make these blue points transparent enough to see what's inside?
I could suggest a hack to try. Given that you approximately know what the colors of the points you want to remove are, you could use findall or findobj to extract the line objects from your plots (maybe they're named something else in a 3D plot, don't have a lot of experience there) and then just delete those with the blue coloration.

matlab determine curvee [duplicate]

This question already has an answer here:
Closed 10 years ago.
i have a plot with many cycles of curves all similar but yet different from each other. the objective is for me to find the mean curve from all this curves. i cannot say where is the beginning or final point from each curve, since each cycle is different.
all i have is an excel file with two columns, one with the x coordinates and the other with the y coordinates.
Any help with be appreciated! thank you very very much!
Try to draw plots of different colors. It will be better for perception.
As you still have this in excel you could just build ONE y coordinate vector (median value) and plot this one.

Getting values from axis on mouse click [duplicate]

This question already has answers here:
Retrieving X and Y values from Matlab Plot
(4 answers)
Closed 9 years ago.
I'm developing a GUI in Matlab that presents a plot (in an axis object). When clicking on a point in the plot, the GUI will open some other plots for that data point.
I added an axis object to my figure and implement the WindowButtonDownFcn to get a button click. I can get the mouse position with
pos=get(hObject,'CurrentPoint');
but how do I convert it to values in my plot? (i.e. which x-value was clicked on)
thanks.
(I'd be happy to hear if there is some simpler way to do this, instead of writing my own GUI)
Try looking up the help on ginput and then set that to some variable. Then plot the points for the number of ginputs you've done.
A lot of it is explained here: http://www.mathworks.com/help/techdoc/ref/ginput.html