# Difference between revisions of "Simulink Tester Issues"

From T-VEC Wiki

(→Limitations) |
(→Embedded Matlab Language (EML) Translation: m-script guidelines) |
||

Line 22: | Line 22: | ||

===Embedded Matlab Language (EML) Translation: m-script guidelines=== | ===Embedded Matlab Language (EML) Translation: m-script guidelines=== | ||

Support for Embedded Matlab Language (EML) functions will be available soon. Not all EML functions will be immediately available but they will be implemented as needed. | Support for Embedded Matlab Language (EML) functions will be available soon. Not all EML functions will be immediately available but they will be implemented as needed. | ||

+ | ====M-Scripting Guidance==== | ||

+ | A majority of the m-script syntax will be supported. A list of the currently supported functions is included. Additionally there are a few unsupported programming shortcuts that are not supported. If your script uses them minor modification will be required. | ||

+ | ====Unsupported syntax==== | ||

+ | =====Matrix field selection using a single parameter===== | ||

+ | Matrix indexing with 1 parameter is not supported. | ||

+ | <br> | ||

+ | m=[1,2,3;4,5,6]; | ||

+ | <br> | ||

+ | x=m(2); % not supported | ||

+ | <br> | ||

+ | <br> | ||

+ | Instead, use row and column syntax for matrix indexing. | ||

+ | <br> | ||

+ | m=[1,2,3;4,5,6]; | ||

+ | <br> | ||

+ | x=m(2,1); | ||

+ | <br> | ||

+ | =====Defining a variable and using it outside of the block containing it===== | ||

+ | The following syntax is not supported. | ||

+ | <br> | ||

+ | function a=fcn1(x) | ||

+ | <br> | ||

+ | if (x==4) | ||

+ | <br> | ||

+ | s=3; % variable s is initialized inside the if block | ||

+ | <br> | ||

+ | end; | ||

+ | <br> | ||

+ | a=x+s; %translation error: variable s is used before it has been initialized | ||

+ | <br> | ||

+ | <br> | ||

+ | Instead, declare variables in the scope they will be used. | ||

+ | <br> | ||

+ | function a=fcn1(x) | ||

+ | <br> | ||

+ | s=0; % variable s is initialized at the function scope | ||

+ | if (x==4) | ||

+ | <br> | ||

+ | s=3; % ok | ||

+ | <br> | ||

+ | end; | ||

+ | <br> | ||

+ | a=x+s; %ok | ||

+ | <br> | ||

+ | |||

+ | |||

+ | |||

====Supported EML functions==== | ====Supported EML functions==== | ||

− | =====Rounding | + | =====Rounding Functions===== |

floor | floor | ||

ceil | ceil | ||

Line 29: | Line 76: | ||

fix | fix | ||

− | =====Trigometric | + | =====Trigometric Functions===== |

sin | sin | ||

cos | cos | ||

Line 44: | Line 91: | ||

atanh | atanh | ||

− | =====Math | + | =====Math Functions===== |

exp | exp | ||

log | log | ||

Line 56: | Line 103: | ||

mod | mod | ||

− | =====Matrix | + | =====Matrix Functions===== |

eye | eye | ||