Вы находитесь на странице: 1из 4

MATLAB Command Window 1/4

July 26, 2018 11:32:03 PM

> % Nama : Moch. Syahrul Siddiq M


> % NIM : 2111161001
> % Tugas 7
> p=[1 -1];
> q=[1 -10/9 1/9];
> s=[1 3/2 1/2];
> t=[1 -3/2 1/2];
> r=conv(s,t)

r=

1.0000 0 -1.2500 0 0.2500

> r=[1 0 -1.25 0 0.25];


> % no 2
> x = (-1.5:0.3:1.5)

x =

Columns 1 through 8

-1.5000 -1.2000 -0.9000 -0.6000 -0.3000 0 0.3000 0.6000

Columns 9 through 11

0.9000 1.2000 1.5000

> nilai1 = polyval(p,x), nilai2 = polyval(q,x), nilai3 = polyval(r,x) nilai1 =

Columns 1 through 8

-2.5000 -2.2000 -1.9000 -1.6000 -1.3000 -1.0000 -0.7000 -0.4000

Columns 9 through 11

-0.1000 0.2000 0.5000

nilai2 =

Columns 1 through 8

4.0278 2.8844 1.9211 1.1378 0.5344 0.1111 -0.1322 -0.1956

Columns 9 through 11

-0.0789 0.2178 0.6944


MATLAB Command Window 2/4
July 26, 2018 11:32:03 PM

nilai3 =

Columns 1 through 8

2.5000 0.5236 -0.1064 -0.0704 0.1456 0.2500 0.1456 -0.0704

Columns 9 through 11

-0.1064 0.5236 2.5000

> % no 3
> x = linespace(-1.5,1.5,11);
Undefined function or variable 'linespace'.

Did you mean:


> x = linspace(-1.5,1.5,11);
> plot(x,nilai1,x,nilai2,x,nilai3)
> grid on
> title('Polinomial p(x), q(x), r(x)')
Warning: The figure is too large for the page and will be cut off. Resize the figure, adjust the output size by
setting the figure's PaperPosition property, use the 'print' command with either the '-bestfit' or '-fillpage'
options, or use the 'Best fit' or 'Fill page' options on the 'Print Preview' window.

> In validate (line 203) In print


(line 67)

> % no 4
> x1 = fzero('f',-10), x2 = fzero('f',1), x3 = fzero('f',10)

x1 =

x2 =

x3 =

> x1 = fzero('f',-9), x2 = fzero('f',-4), x3 = fzero('f',9)

x1 =
MATLAB Command Window 3/4
July 26, 2018 11:32:03 PM
1

x2 =

x3 =

> x = linspace(-10,10);
> plot(x,f(x));
> grid on
> title('Fungsi f(x)')
> x1 = fzero('f',-10), x2 = fzero('f',1), x3 = fzero('f',10)

x1 =

x2 =

x3 =

> minimum_fungsi = fminbnd('f',-10,10)

minimum_fungsi =

-0.4142

> maximum_fungsi = fminbnd('minusf',-10,10)

maximum_fungsi =

2.4142

> % no 5
> x = linspace (-2,2);
> y = linspace (-2,2);
> for i = 1:50
for j = 1:50
MATLAB Command Window 4/4
July 26, 2018 11:32:03 PM

Z(i,j) = gxy([x(i) x(j)]);


end
end
Not enough input arguments.

Error in gxy (line 2)


g = sin(x).*sin(y) + sin(x.*y);

> for i = 1:50 for j


= 1:50
Z(i,j) = gxy([x(i) y(j)]); end

end
Not enough input arguments.

Error in gxy (line 2)


g = sin(x).*sin(y) + sin(x.*y);

Warning: The figure is too large for the page and will be cut off. Resize the figure, adjust the output size by
setting the figure's PaperPosition property, use the 'print' command with either the '-bestfit' or '-fillpage'
options, or use the 'Best fit' or 'Fill page' options on the 'Print Preview' window.

> In validate (line 203) In print


(line 67)
In printdlg (line 61)
Error using print (line 82)
There was a problem using the printer.

Error in printdlg (line 61)


print(Fig, '-v');

Error while evaluating PushTool ClickedCallback.

Warning: The figure is too large for the page and will be cut off. Resize the figure, adjust the output size by
setting the figure's PaperPosition property, use the 'print' command with either the '-bestfit' or '-fillpage'
options, or use the 'Best fit' or 'Fill page' options on the 'Print Preview' window.

> In validate (line 203) In print


(line 67)
In printdlg (line 61)
>>

Вам также может понравиться