Passing a strange function handle to MATLAB ode solvers - What does this code mean? -


I know how to use ode15s or other audio solver in MATLAB, which I'm not sure about, This code (from) which seems vague to me:

  [VOI, state] = ODE 15S (@ (VOI, state) Mathematical calculations (VOI, states, Constants), Tapan, INIT_STATES, options); More clearly, what is the meaning of the following (?):  
  @ (VOI, state) Compute rights (VOI, status, constants)   The function's header "computeRates" is the following:  
  function [rate, algorithm] = computeRates (T, state, CONSTANTS)   

/ code>

I know that the handles of the "cutout rights" function means, but what does that mean?

  @ (VOI, state) Compute rights (VOI, status, Constant's)   

Why Has it been put in (VOI, state) @ and between "Computers"?

By the way, according to MATLAB support, if we want to integrate the following functions:

  function dy = rigid (t, y) dy = zeros (3, 1) ); % A column vector D (1) = y (2) * y (3); D (2) = -y (1) * y (3); D (3) = -0.51 * y (1) * y (2);   

We just have to write:

  options = odeset ('RelTol', 1e-4, 'AbsTol', [1e-4 1e-4] 1e-5]); [T, Y] = ode45 (@rigid, [0 12], [0 1], option)    

As you can, the one you use in that code is one. Creating one is done in the following manner:

  fhandle = @ (arglist) expr   

where there is a list of arglist Input arguments used in the calculation of the input expression expr

Can you be confused about the why code is necessary that an anonymous function can be created instead of just using an existing function for MATLAB solver Two inputs will be passed in routine such as only the function passed by them: a scalar t and a column vector y . If you have a situation where you want more parameters in the function to define your behavior, then you have to provide the function with that parameter in other ways as described in the documentation.

Anonymous Function One way to do this In your example, you can see that the function computeRates gives a third argument constants with additional parameters Function provides when an anonymous operation is performed, then this third input is fixed on the value (s) contained in that moment, the anonymous function therefore acts as a wrapper that acts as a two-input function for the three-input function Behaves so that it To be used by the Oliver routine, the wrapped function can be provided with additional input for which the solver can not run routine, pass it.

Comments