SlideShare a Scribd company logo
BY
Uday Saikia
>> p=[1 -12.1 40.59 -17.015 -71.95 35.88]
>> r=roots(p)
r=
6.5000
4.0000
2.3000
-1.2000
0.5000
6x-2
p=polyfit(x,y,n)
here p=A vector of the co-efficients of
the polynomial that fits the
data
co-

x=A vector with the horizontal
ordinate of the data points
y= A vector with the vertical
co-ordinate of the data points
n=Degree of polynomial
Here,

‘nearest’ : returns the value of the
data point that is nearest to the
yi = interpl (x, y, xi, ‘method’) interpolated point
‘linear’ : uses linear spline
interpolation
‘spline’ : uses cubic spline
interpolation
yi = It is Interpolated value
‘pchip’ : uses piecewise cubic Hermite
interpolation

x = It is a vector with horizontal co-ordinate of the input data
points

y = It is a vector with vertical co-ordinate of the input data points
xi = Horizontal co-ordinate of the interpolation point
x

0

1

2

y

1.0

-0.6242 -1.4707

3

4

5

3.2406

-0.7366 -6.3717
>> x=[0:1.0:5];
y=[1.0 -0.6242 -1.4707 3.2406 -0.7366 -6.3717];
xi=[0:0.1:5];
yilin=interpl(x,y,xi,'linear');
yispl=interpl(x,y,xi,'spline');
yipch=interpl(x,y,xi,'pchip');
yfun=1.5.^xi*cos(2*xi);
subplot(1,3,1)
plot(x,y,'o'xi,yfun,xi,yilin,'--');
subpolt(1,3,2)
plot(x,y,'o',xi,yfun,xi,yispl,'--');
subplot(1,3,3)
plot(x,y,'o',xi,yfun,xi,yipch,'--')
Mesh & Surface plots are created in three steps:
*create a grid in the x-y plane
*calculate the value of z at each point of the grid
*create the plot
>> x=-1:0.1:3;
>> y=1:0.1:4;
>> [X,Y]=meshgrid(x,y);
>> Z=X.*Y.^2./(X.^2+Y.^2);
>> mesh(X,Y,Z)
>> xlabel('x');
>> ylabel('y');
>> zlabel('z');

More Related Content

More from Dr. Uday Saikia

Middleware
MiddlewareMiddleware
Middleware
Dr. Uday Saikia
 
LPC for Speech Recognition
LPC for Speech RecognitionLPC for Speech Recognition
LPC for Speech Recognition
Dr. Uday Saikia
 
Brain Computer Interfaces(BCI)
Brain Computer Interfaces(BCI)Brain Computer Interfaces(BCI)
Brain Computer Interfaces(BCI)
Dr. Uday Saikia
 
Intelligence and artificial intelligence
Intelligence and artificial intelligenceIntelligence and artificial intelligence
Intelligence and artificial intelligence
Dr. Uday Saikia
 
Quality management
Quality managementQuality management
Quality management
Dr. Uday Saikia
 
Artificial Neural Network / Hand written character Recognition
Artificial Neural Network / Hand written character RecognitionArtificial Neural Network / Hand written character Recognition
Artificial Neural Network / Hand written character Recognition
Dr. Uday Saikia
 

More from Dr. Uday Saikia (6)

Middleware
MiddlewareMiddleware
Middleware
 
LPC for Speech Recognition
LPC for Speech RecognitionLPC for Speech Recognition
LPC for Speech Recognition
 
Brain Computer Interfaces(BCI)
Brain Computer Interfaces(BCI)Brain Computer Interfaces(BCI)
Brain Computer Interfaces(BCI)
 
Intelligence and artificial intelligence
Intelligence and artificial intelligenceIntelligence and artificial intelligence
Intelligence and artificial intelligence
 
Quality management
Quality managementQuality management
Quality management
 
Artificial Neural Network / Hand written character Recognition
Artificial Neural Network / Hand written character RecognitionArtificial Neural Network / Hand written character Recognition
Artificial Neural Network / Hand written character Recognition
 

Recently uploaded

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 

Recently uploaded (20)

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 

POLYNOMIALS,CURVEFITTING, AND INTERPOLATION

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. >> p=[1 -12.1 40.59 -17.015 -71.95 35.88] >> r=roots(p) r= 6.5000 4.0000 2.3000 -1.2000 0.5000
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. 6x-2
  • 13. p=polyfit(x,y,n) here p=A vector of the co-efficients of the polynomial that fits the data co- x=A vector with the horizontal ordinate of the data points y= A vector with the vertical co-ordinate of the data points n=Degree of polynomial
  • 14. Here, ‘nearest’ : returns the value of the data point that is nearest to the yi = interpl (x, y, xi, ‘method’) interpolated point ‘linear’ : uses linear spline interpolation ‘spline’ : uses cubic spline interpolation yi = It is Interpolated value ‘pchip’ : uses piecewise cubic Hermite interpolation x = It is a vector with horizontal co-ordinate of the input data points y = It is a vector with vertical co-ordinate of the input data points xi = Horizontal co-ordinate of the interpolation point
  • 15.
  • 17. >> x=[0:1.0:5]; y=[1.0 -0.6242 -1.4707 3.2406 -0.7366 -6.3717]; xi=[0:0.1:5]; yilin=interpl(x,y,xi,'linear'); yispl=interpl(x,y,xi,'spline'); yipch=interpl(x,y,xi,'pchip'); yfun=1.5.^xi*cos(2*xi); subplot(1,3,1) plot(x,y,'o'xi,yfun,xi,yilin,'--'); subpolt(1,3,2) plot(x,y,'o',xi,yfun,xi,yispl,'--'); subplot(1,3,3) plot(x,y,'o',xi,yfun,xi,yipch,'--')
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. Mesh & Surface plots are created in three steps: *create a grid in the x-y plane *calculate the value of z at each point of the grid *create the plot
  • 23.
  • 24. >> x=-1:0.1:3; >> y=1:0.1:4; >> [X,Y]=meshgrid(x,y); >> Z=X.*Y.^2./(X.^2+Y.^2); >> mesh(X,Y,Z) >> xlabel('x'); >> ylabel('y'); >> zlabel('z');