how to obtain data from plots
2 views (last 30 days)
Show older comments
I want to get data from the plot(a,b), if i only know three points in 'a' and three points in 'b'
for an example a=[52 104 157] and b=[0.1 0.4 0.4 ] and i want to know the values of remaining points (e.g value of 'b' for 'a'= 60 etc.)
I want to get all the data points in between in a new file.
please help me with any ideas
Regards Agassi
0 Comments
Accepted Answer
Star Strider
on 28 Mar 2015
Use the interp1 function to do the interpolation:
a=[52 104 157];
b=[0.1 0.4 0.4 ];
b60 = interp1(a, b, 60)
produces:
b60 =
0.146153846153846
2 Comments
Star Strider
on 28 Mar 2015
My pleasure!
Use a vector of values in interp1 rather than a single value.
Since ‘all possible points’ is infinite, I will illustrate a finite version instead:
aq = linspace(min(a), max(a), 10)'; % Query Vector For ‘a’
bq = interp1(a, b, aq) % Interpolated Values At ‘aq’
produces:
bq =
100.0000e-003
167.3077e-003
234.6154e-003
301.9231e-003
369.2308e-003
400.0000e-003
400.0000e-003
400.0000e-003
400.0000e-003
400.0000e-003
More Answers (0)
See Also
Categories
Find more on Scatter 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!