.


:




:

































 

 

 

 





, , , . SciLab.

1. deff, :

deff([1,...,N] = _(_1,...,_M), 1=1;...;N=N)

1,...,N - , , ,

_ - , ,

_1,...,_M - .

.

, , .

, .

, , (!) . , !

. f(x)=sin(cos(x)) {-1,3; 2,1; 3,7}.

-->deff('f=fun(x)','f=sin(cos(x))')

-->[fun(-1.3) fun(2.1) fun(3.7)]

ans = 0.2643200 - 0.4836727 - 0.7500251

2. function, :

function [1,...,N]=_(_1,...,_M)

endfunction

1,...,N ;

_ , _1,...,_M .

.

. f(x)=sin(cos(x)) {-1,3; 2,1; 3,7}.

-->function f=fun(x)

-->f=sin(cos(x))

-->endfunction

-->[fun(-1.3) fun(2.1) fun(3.7)]

ans = 0.2643200 - 0.4836727 - 0.7500251

. , f(x,y)=cos(x+y) g(x,y)=sin(x-y) (-2,5; 1,7).

-->deff('[f,g]=fnc(x,y)','f=cos(x+y);g=sin(x-y)')

-->[f1,g1]=fnc(-2.5,1.7)

g1 = 0.8715758

f1 = 0.6967067

-->function[f,g]=fnc(x,y)

-->f=cos(x+y)

-->g=sin(x-y)

-->endfunction

-->[f2,g2]=fnc(-2.5,1.7)

g2 = 0.8715758

f2 = 0.6967067

,

, .. .

, SciLab . .

.

- sci sce.

, , .. . , , , , exec(_) File Exec..., , , .

, - cub .

function [ x1, x2, x3 ]= cub (a, b, c, d)

r= b / a;

s= c / a;

t= d / a;

p=(3*s-r^2)/3;

q=2*r^3/27-r*s/3+t;

D=(p/3)^3+(q/2)^2;

u=(-q/2+sqrt(D))^(1/3);

v=(-q/2-sqrt(D))^(1/3);

y1=u+v;

y2=-(u+v)/2+(u-v)/2*%i*sqrt(3);

y3=-(u+v)/2-(u-v)/2*%i*sqrt(3);

x1 =y1-r/3;

x2 =y2-r/3;

x3 =y3-r/3;

endfunction

, .. ,

-->exec('e:\\SciLab\\cub.sce');

-->[x1,x2,x3]=cub(3,-20,-3,4)

x3 = 0.3880206

x2 = - 0.5064407

x1 = 6.7850868





:


: 2015-01-25; !; : 709 |


:

:

, , .
==> ...

1553 - | 1453 -


© 2015-2024 lektsii.org - -

: 0.011 .