0% found this document useful (0 votes)
19 views

Tugas Matlab

The document contains the output of various polynomial fitting and analysis operations performed in MATLAB. Various polynomials p, r, p1, r1, p2, r2 are fitted to datasets and evaluated. Operations like polynomial integration, differentiation, convolution and deconvolution are also demonstrated.

Uploaded by

Sabil Bile
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Tugas Matlab

The document contains the output of various polynomial fitting and analysis operations performed in MATLAB. Various polynomials p, r, p1, r1, p2, r2 are fitted to datasets and evaluated. Operations like polynomial integration, differentiation, convolution and deconvolution are also demonstrated.

Uploaded by

Sabil Bile
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

>> x=[1 2 3 4 5];y=[0 14 44 96 176];

ANSWER a.1.1

>> p=polyfit(x,y,4)

p=

0.0000 1.0000 2.0000 1.0000 -4.0000

ANSWER a.1.2

>> r=[x.^4 x.^3 x.^2 x ones(size(x))]\y

r=

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0.0224 0.0704 0.1536 0.2816

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0
0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

ANSWER a.2.1

>> p1=polyfit(x,1./(5*x-y),4)

p1 =

0.0433 -0.5762 2.7078 -5.1892 3.2143

ANSWER a.2.2

>> r1=[x.^4 x.^3 x.^2 x ones(size(x))]\(1./(5*x-y))

r1 =

1.0e-003 *

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0.3200 -0.4000 -0.0552 -0.0211 -0.0106


0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

ANSWER a.3.1

>> p2=polyfit(x,log(y+30*x),4)

p2 =

-0.0059 0.0914 -0.5547 2.0162 1.8542

ANSWER a.3.2
>> r2=[x.^4 x.^3 x.^2 x ones(size(x))]\log(y+30*x)

r2 =

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0.0054 0.0069 0.0078 0.0086 0.0093

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0
ANSWER b.1

>> x1=[1.5 2.5 3.5 4.5];y1=polyval(p,x1)

y1 =

5.3750 26.6250 66.8750 132.1250

ANSWER b.2

>> y=@(x)polyval(p,x)-45;x=fzero(y,1)

x=

3.0248

ANSWER b.3

>> polyval(polyint(p),1.5)- polyval(polyint(p),6)

ans =

-463.3594

ANSWER b.4

>> q=polyint(p);y=@(b)polyval(q,1)-polyval(q,b)-3;b=fzero(y,1)

b=

-3.6370e+014
ANSWER b.5

>> hasilbagi=deconv(p,[1 -3]),hasilkali=conv(p,[1 -3])

hasilbagi =

0.0000 1.0000 5.0000 16.0000

hasilkali =

0.0000 1.0000 -1.0000 -5.0000 -7.0000 12.0000

ANSWER b.6

Tidak ada

You might also like