Contents

mlNl011R.m Funktion nollakohdat

close all
clear
format

f=@(x)(x-1).*sin(12*x./(x.^2+0.4*x+.1))
x=linspace(-4,4,1000);
plot(x,f(x)); grid on;shg
f = 

    @(x)(x-1).*sin(12*x./(x.^2+0.4*x+.1))

x=linspace(-4,-2,1000);
plot(x,f(x)); grid on;shg
N=1
N =

     1

figure
x=linspace(-2,-1,1000);
plot(x,f(x)); grid on;shg
N=N+3
N =

     4

figure
x=linspace(-1,-0.3,1000);
plot(x,f(x)); grid on;shg
N=N+11
N =

    15

figure
x=linspace(-.3,.1,1000);
plot(x,f(x)); grid on;shg
N=N+19
N =

    34

x=linspace(.1,4,1000);
plot(x,f(x)); grid on;shg
N=N+5
disp(['Nollakohtien lkm = ',num2str(N)])
N =

    39

Nollakohtien lkm = 39
x=linspace(-.2,-.1,1000);
plot(x,f(x)); grid on;shg

Pienin nollakohta valilla [-0.2,-0.1]

fzero(f,-0.19)
ans =

   -0.1889