obtain values of amplitude after executing plot command
1 view (last 30 days)
Show older comments
Siddharth Singh
on 2 Jan 2020
Commented: Image Analyst
on 2 Jan 2020
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);
0 Comments
Accepted Answer
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
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.
More Answers (0)
See Also
Categories
Find more on Annotations 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!