plot 8 cycles sin graph, convert to discrete and measure?

Hie guys, can i know how to plot a sin graph with a amplitude 22000 which have 8 cycles inside from range 0 to 1024. I try to plot, but it goes from small to big.
If is possible to convert the sin graph to discrete function and measure the point?How to implement it?
THANKS
Lynn

 Accepted Answer

I don't know what you mean by "convert the graph to a discrete function." Do you mean you want to get a point from the graph? If so, then look at the GINPUT function. If not, then please explain better.
.
.
.
.
EDIT The new question, as it evolves...
t = 1:.1:1024;
f = @(x) 22000*sin(x);
plot(t,f(t))
pause(.5)
% Notice that this is more than 8 cycles, so let's zoom in:
xlim([t(1) 16*pi+t(1)])

6 Comments

I want to convert my sin graph into discrete data.
xd = get(get(gca,'child'),'xdata');
yd = get(get(gca,'child'),'ydata');
Note that the above assumes there is only one plot on the axes. If there is more than one plot, you should look at the children of the axes and determine which line is the one you want, then get its xdata and ydata. Alternatively, why not just use the data which was used to make the plot??
Do u mind teaching me, how to plot 8 cycles of sin wave from t = 1 to 1024? I could not specificly have the x-axis correct.
That is a different question than the one you asked before. But see above.
Thanks for the code Matt
Matt can i know what is @x?and what is the parameters xlim?
Is it possible to change the frequency for the sin graph?

Sign in to comment.

More Answers (0)

Categories

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

Tags

Community Treasure Hunt

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

Start Hunting!