MATLAB è Simulink íà ðóññêîì

https://hub.exponenta.ru/

MATLAB

.. " Matlab" (v 5.3)
3. Matlab 5

  \ \ \

3.6.

, , MATLAB . . , .

Eval

:

           eval('')

:

eval('') , , , .

t:

              format rational
               eval('t = clock')

               t = 1997   12    7   17   24   241/100

n:

               t = '1/(i + j-1)';
               n = 4;
               for i = 1:n
                  for j = 1:n
                       G(i, j) = eval(t);
                  end
               end
               format rational
               G

               G =

1 1/2 1/3 1/4
1/2 1/3 1/4 1/5
1/3 1/4 1/5 1/6
1/4 1/5 1/6 1/7

 

Feval

:

            feval('<_>', x1, ..., xn)

:

feval eval , . feval input, , .


fun . x:

             fun = ['sin'; 'cos'; 'log']
             fun =
                  sin
                  cos
                  log
             k = input(' : ')
             : 2

             k =      2

             x = input(' x: ')
             x: 1

             x =     1
            format rational
            feval(fun(k, :), x)

            ans =     429/794

, , feval eval. -, feval MATLAB .

. , eval.


, 3 P1, P2, P3 :

        for i=1 : 3
              eval(['P', int2str(i),' = i.^2'])
         end

         P1 =   1
         P2 =   4
         P3 =   9

  \ \ \

 


:


 Orphus