How to download polyparci file and run it with matlab code becsause there iss no polyparci command in-built of MATLAB

1 回表示 (過去 30 日間)
clc();
xval = [4 8 11 16 17 19 21 25 32 34];
%X values as given in question
yval = [0.33 0.9 1.41 1.99 1.7 2.25 2.60 2.71 3.33 4.01];
%y values as given in question [p,S]=polyfit(xval,yval,1);
fprintf('Fitted equation of straight line to the given data is:
y=%f(x)+%f\n',p(1),p(2));
ci = polyparci(p,S);
fprintf('\n95 percent confidence inetrval for the slope coefficient is (%f,%f) and for the intercept is (%f,%f):',ci(1,1),ci(2,1),ci(1,2),ci(2,2));
y_1=ci(1,1)*xval+ci(1,2);
y_2=ci(2,1)*xval+ci(2,2);
y_3=(p(1)*xval)+p(2);
figure
plot(xval, yval, 'o')
hold on
plot(xval,y_1)
hold on
plot(xval,y_2)
hold on
plot (xval,y_3)

回答 (1 件)

Matt J
Matt J 2021 年 4 月 16 日

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by