Vous êtes sur la page 1sur 4

MATLAB Command Window Page 1

>> % Fonction f(x) = -x^4 + 2x^2 + 1


>> f = [-1 0 2 0 1]

f =

-1 0 2 0 1

>> % Dérivée de f
>> df = polyder(f)

df =

-4 0 4 0

>> % Racines de f
>> Z = roots(f)

Z =

-1.5538 + 0.0000i
1.5538 + 0.0000i
0.0000 + 0.6436i
0.0000 - 0.6436i

>> % x dans l'inervalle [-2;2] avec un pas de 0.01


>> x = -2:0.01:2;
>> % Evaluation de f
>> y = polyval(f,x)

y =

Columns 1 through 12

-7.0000 -6.7622 -6.5287 -6.2996 -6.0747 -5.8540 -5.6375 -5.4251


-5.2167 -5.0124 -4.8121 -4.6157

Columns 13 through 24

-4.4232 -4.2345 -4.0496 -3.8685 -3.6911 -3.5173 -3.3472 -3.1806


-3.0176 -2.8581 -2.7020 -2.5493

Columns 25 through 36

-2.3999 -2.2539 -2.1112 -1.9717 -1.8353 -1.7022 -1.5721 -1.4451


-1.3211 -1.2002 -1.0821 -0.9670

Columns 37 through 48

-0.8547 -0.7453 -0.6387 -0.5348 -0.4336 -0.3351 -0.2392 -0.1459


-0.0552 0.0330 0.1187 0.2020

Columns 49 through 60

0.2829 0.3613 0.4375 0.5114 0.5829 0.6523 0.7195 0.7845


0.8474 0.9082 0.9669 1.0237
MATLAB Command Window Page 2

Columns 61 through 72

1.0784 1.1312 1.1821 1.2310 1.2782 1.3235 1.3670 1.4088


1.4488 1.4872 1.5239 1.5590

Columns 73 through 84

1.5924 1.6244 1.6547 1.6836 1.7110 1.7369 1.7615 1.7846


1.8064 1.8269 1.8460 1.8639

Columns 85 through 96

1.8806 1.8960 1.9102 1.9233 1.9353 1.9461 1.9559 1.9646


1.9723 1.9790 1.9847 1.9895

Columns 97 through 108

1.9933 1.9963 1.9984 1.9996 2.0000 1.9996 1.9984 1.9965


1.9939 1.9905 1.9865 1.9817

Columns 109 through 120

1.9764 1.9705 1.9639 1.9568 1.9491 1.9409 1.9322 1.9230


1.9133 1.9032 1.8927 1.8817

Columns 121 through 132

1.8704 1.8587 1.8466 1.8343 1.8216 1.8086 1.7953 1.7818


1.7681 1.7541 1.7399 1.7255

Columns 133 through 144

1.7110 1.6963 1.6815 1.6665 1.6514 1.6363 1.6210 1.6057


1.5904 1.5750 1.5596 1.5442

Columns 145 through 156

1.5289 1.5135 1.4982 1.4829 1.4677 1.4525 1.4375 1.4226


1.4077 1.3930 1.3784 1.3640

Columns 157 through 168

1.3497 1.3356 1.3217 1.3079 1.2944 1.2811 1.2679 1.2551


1.2424 1.2300 1.2178 1.2059

Columns 169 through 180

1.1943 1.1830 1.1719 1.1611 1.1507 1.1405 1.1306 1.1211


1.1119 1.1030 1.0945 1.0863

Columns 181 through 192

1.0784 1.0709 1.0638 1.0570 1.0505 1.0445 1.0388 1.0335


1.0286 1.0241 1.0199 1.0161
MATLAB Command Window Page 3

Columns 193 through 204

1.0128 1.0098 1.0072 1.0050 1.0032 1.0018 1.0008 1.0002


1.0000 1.0002 1.0008 1.0018

Columns 205 through 216

1.0032 1.0050 1.0072 1.0098 1.0128 1.0161 1.0199 1.0241


1.0286 1.0335 1.0388 1.0445

Columns 217 through 228

1.0505 1.0570 1.0638 1.0709 1.0784 1.0863 1.0945 1.1030


1.1119 1.1211 1.1306 1.1405

Columns 229 through 240

1.1507 1.1611 1.1719 1.1830 1.1943 1.2059 1.2178 1.2300


1.2424 1.2551 1.2679 1.2811

Columns 241 through 252

1.2944 1.3079 1.3217 1.3356 1.3497 1.3640 1.3784 1.3930


1.4077 1.4226 1.4375 1.4525

Columns 253 through 264

1.4677 1.4829 1.4982 1.5135 1.5289 1.5442 1.5596 1.5750


1.5904 1.6057 1.6210 1.6363

Columns 265 through 276

1.6514 1.6665 1.6815 1.6963 1.7110 1.7255 1.7399 1.7541


1.7681 1.7818 1.7953 1.8086

Columns 277 through 288

1.8216 1.8343 1.8466 1.8587 1.8704 1.8817 1.8927 1.9032


1.9133 1.9230 1.9322 1.9409

Columns 289 through 300

1.9491 1.9568 1.9639 1.9705 1.9764 1.9817 1.9865 1.9905


1.9939 1.9965 1.9984 1.9996

Columns 301 through 312

2.0000 1.9996 1.9984 1.9963 1.9933 1.9895 1.9847 1.9790


1.9723 1.9646 1.9559 1.9461

Columns 313 through 324

1.9353 1.9233 1.9102 1.8960 1.8806 1.8639 1.8460 1.8269


1.8064 1.7846 1.7615 1.7369
MATLAB Command Window Page 4

Columns 325 through 336

1.7110 1.6836 1.6547 1.6244 1.5924 1.5590 1.5239 1.4872


1.4488 1.4088 1.3670 1.3235

Columns 337 through 348

1.2782 1.2310 1.1821 1.1312 1.0784 1.0237 0.9669 0.9082


0.8474 0.7845 0.7195 0.6523

Columns 349 through 360

0.5829 0.5114 0.4375 0.3613 0.2829 0.2020 0.1187 0.0330


-0.0552 -0.1459 -0.2392 -0.3351

Columns 361 through 372

-0.4336 -0.5348 -0.6387 -0.7453 -0.8547 -0.9670 -1.0821 -1.2002


-1.3211 -1.4451 -1.5721 -1.7022

Columns 373 through 384

-1.8353 -1.9717 -2.1112 -2.2539 -2.3999 -2.5493 -2.7020 -2.8581


-3.0176 -3.1806 -3.3472 -3.5173

Columns 385 through 396

-3.6911 -3.8685 -4.0496 -4.2345 -4.4232 -4.6157 -4.8121 -5.0124


-5.2167 -5.4251 -5.6375 -5.8540

Columns 397 through 401

-6.0747 -6.2996 -6.5287 -6.7622 -7.0000

>> % Tracé de f en traits interrompus et couleur bleue, titre de la figure, titres sur
les axes
>> plot(x,y,'b--')
>> title('f(x) = -x^4 + 2x^2 + 1')
>> xlabel('Axe x (-2 < x < 2)')
>> ylabel('Axe y')
>>

Vous aimerez peut-être aussi