Extract fitting results in a vector

2 views (last 30 days)
Davide Cerra
Davide Cerra on 28 Jun 2019
Commented: dpb on 28 Jun 2019
Hello
i would like to extract a vector from the fitting results. the vector length is 360.
Ph=200;
Pc=100;
w=220;
x=[0 w/2 w w+(360-w)/2 360];
y=[0 Ph -Pc 0];
[xData,yData] = prepareCurveData (x,y);
ft='pchipinterp'
fitresult=fit(xData, yData,ft,'Normalize','on');
  1 Comment
dpb
dpb on 28 Jun 2019
>> Ph=200;
Pc=100;
w=220;
x=[0 w/2 w w+(360-w)/2 360];
y=[0 Ph -Pc 0];
[xData,yData] = prepareCurveData (x,y);
ft='pchipinterp'
fitresult=fit(xData, yData,ft,'Normalize','on');
Error using prepareCurveData>iAssertInputsHaveSameNumElements (line 47)
Data sizes do not match. All the data for curve fitting must have the same number of elements.
Error in prepareCurveData (line 37)
iAssertInputsHaveSameNumElements( varargin{:} );
>>

Sign in to comment.

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!