how to obtain data from plots

2 次查看(过去 30 天)
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

采纳的回答

Star Strider
Star Strider 2015-3-28
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 个评论
Agastya
Agastya 2015-3-28
Thank u for early reply, can u please let me know how to get all the possible values of a and b other than those three values
Star Strider
Star Strider 2015-3-28
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by