Hi,I want to find maximum value from the plot of interpolation

2 views (last 30 days)
clear all;clc;
rng(4);
x = [0.000000 2.038941 3.965975 5.988320 7.989983 10.024795 12.001537 14.023893 16.008968 18.002214 19.987403 22.001464 23.998955 26.021273 27.977311 29.498310];
y = [-0.000940 0.054940 0.124380 0.199366 0.297254 0.393073 0.500862 0.607698 0.714412 0.830266 0.945129 1.073882 1.156730 1.267062 1.289448 1.330006];
s = csaps(x,y);sn = fnxtr(s);
figure(2) % grid on; fnplt(s,[0 43],3),hold on,fnplt(sn,[0 29.5],0.5,'r',2); plot(x,y,'k-s')
here is the code with 2 arrays x and y,i interpolate it but i want to find the maximum value from the plot in blue,please help me, Thankx
  1 Comment
Geoff Hayes
Geoff Hayes on 23 Apr 2014
Hi Muahmmad,
Please edit your above question so that it is formatted as readable code. Use the {}Code button to do so.
I'm going to guess that the first plot you execute is the one that is coloured in blue, fnplt(s,[0 43],3). Is this the case? If so, then I suppose you could do something like:
[points,t] = fnplt(s,[0 43],3);
where, according to fnplt the values that would have been plotted by fnplt are returned in points. Then max(points) would then find the maximum value that you are looking for. (Of course, then you would have to manually plot the data afterwards.)
Geoff

Sign in to comment.

Answers (0)

Categories

Find more on Spline Postprocessing 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!