I've tried with findpeak function but it return me an error message:
>> PV=plot(U,P)
PV =
Line with properties:
Color: [0 0.4470 0.7410]
LineStyle: '-'
LineWidth: 0.5000
Marker: 'none'
MarkerSize: 6
MarkerFaceColor: 'none'
XData: [1x262 double]
YData: [1x262 double]
ZData: [1x0 double]
Show all properties
>> findpeaks(PV)
Error using findpeaks
Expected Y to be one of these types:
numeric
Instead its type was matlab.graphics.chart.primitive.Line.
Error in findpeaks>parse_inputs (line 191)
validateattributes(Yin,{'numeric'},{'nonempty','real','vector'},...
Error in findpeaks (line 134)
= parse_inputs(Yin,varargin{:});