Posts

Showing posts with the label polyfit

eg10_1

Image
 eg10_1 code1: clear clc a=[0.1 1;0.2 1.1;0.3 1.2;0.4 1.3;0.5 1.1;0.6 0.9;0.7 0.7;0.8 1.0;0.9 1.2;1 1.3]; plot(a(:,1),a(:,2), '*' );%fig(b) axis([0.1 1 0.5 1.5]); pause p=polyfit(a(:,1),a(:,2),4); fprintf( 'order of polynomial is 4' ); p t=[0.1:0.001:0.95]; nev=polyval(p,t); plot(t,nev,a(:,1),a(:,2), '*' );%fig(c) axis([0 1.1 0.6 1.4]); grid title( 'order of polynomial is 4' ); xlabel( 'input data' ); ylabel( 'output data' ); pause fig(a) fig(b) fig(c)

How to get an approximately value with number data with specified polynomial in MatLab? - polyfit -- MatLab

Image
 How to  get an approximately value with number data with specified polynomial in MatLab? - polyfit -- MatLab How to  get an apprixmate value with number data with specified polynomial in MatLab? [Ans] polyfit [syntax] [<p>,<S>,<mu>] = polyfit(<x>,<y>,<n>) ; [description] [<p>,<S>,<mu>] = polyfit(<x>,<y>,<n>) ; It will return approximately value with x-axis data <x> and y-axis data <y> which is represented with degree n of the polynomial. <p> coefficient of polynomial <S> structure of polynomial <mu> population of mean in distribution more details about mu (one of Greek Letters) on: μ - Wiktionary Mu (letter) - Wikipedia statistics - How do I calculate mu and sigma? - Mathematics Stack Exchange more details on: Polynomial curve fitting - MATLAB polyfit (mathworks.com) code clear clc x = linspace(0,4*pi,10); y = sin(x); p = polyfit(x,y,7) %{ p = -0.0001 0.0028 -0.0...