SlideShare uma empresa Scribd logo
1 de 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');

Mais conteúdo relacionado

Mais de Dr. Uday Saikia

Mais de 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
 

Último

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Último (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

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');