SlideShare a Scribd company logo
1 of 24
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

LPC for Speech Recognition
LPC for Speech RecognitionLPC for Speech Recognition
LPC for Speech RecognitionDr. 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 intelligenceDr. 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 RecognitionDr. 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

ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 

Recently uploaded (20)

ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.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');