obtain values of amplitude after executing plot command

1 view (last 30 days)
how to obtain values of the obtained plot's amplitude in an array after running the plot command ?
I want to store the values of the amplitude's at different time intervals in aray [y], but this command does not yields it.
t = 0:0.001:100;
x1 = 1.1785*((t/pi));
[y] = plot(x1,t);

Accepted Answer

Image Analyst
Image Analyst on 2 Jan 2020
What is your definition of amplitude? The value of x1 is the amplitude of your signal at every value of t.
y is the handle to the curve on your graph that plot() created. y is not the amplitude of anything.
  2 Comments
Siddharth Singh
Siddharth Singh on 2 Jan 2020
I desire to obtain the values of x1 in an array how can I achieve it
Image Analyst
Image Analyst on 2 Jan 2020
You already did obtain the whole array when you did this:
x1 = 1.1785*((t/pi));
If you want to obtain a subset of values from x1 into another array, you have to specify the starting and stopping indexes. Like if you wanted to store the 4th through 9th elements in x2, then do
x2 = x1(4:9); % Extract elements 4-9 into a new vector x2.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!