Transitioning Xmath Operators and Variables to MATLAB
| Permanent Variables | Xmath | MATLAB | Notes | |||
|---|---|---|---|---|---|---|
| precision of machine | eps | eps | both: 2.2204e-016 | |||
| global error status | err | n/a | ||||
| largest finite number | huge | realmax | REALMAX is four times larger than huge | |||
| infinity | inf | inf, Inf | ||||
| sqrt(-1) | jay | i, j | ||||
| Not-A-Number | nan | NaN | ||||
| empty object | null | [] | ex: variable = []; | |||
| Pi | pi | pi | ||||
| smallest nonzero number | tiny | realmin | both: 2.2251e-308 | |||
| Operators -- Math and Logical | Xmath | MATLAB | Notes | |||
| and | & | & | ||||
| or | | | | | ||||
| not | ! | ~ | ||||
| addition | + | + | ||||
| subtraction | - | - | ||||
| multiplication | * | * | ||||
| right division | / | / | ||||
| left division | \ | \ | ||||
| transpose | ' | .' | ||||
| elementwise multiplication | .* | .* | ||||
| elementwise right division | ./ | ./ | ||||
| elementwise left division | .\ | .\ | ||||
| Kronecker product | .*. | kron | ||||
| Kronecker right division | ./. | NONE | ||||
| Kronecker left division | .\. | NONE | ||||
| less than | < | < | ||||
| greater than | > | > | ||||
| less than or equal | <= | <= | ||||
| greater than or equal | >= | >= | ||||
| equality | == | == | ||||
| not equal | <> | ~= | ||||
| power | **, ^ | ^ | ||||
| complex conjugate transpose | *' | ' | ||||
| decimal | . | . | ||||
| Partition delimiter | . | NONE | MATLAB does not have partitions | |||
| raise elements to a power | .** | .^ | ||||
| raise elements to a power | .^ | .^ | ||||
| Hermitian (complex conjugate) transpose | '* | NONE | ||||
| indexing and precedence | () | () | Index into matrix OR Indicate order of operations | |||
| matrix construction and concatenation | [] | [] | See also STRCAT and STRVCAT for string concatenation | |||
| keyword delimeters for functions | {} | NONE | ||||
| indexing | : | : | ||||
| show output | ? | NONE | MATLAB will display results if a trailing semicolon is not present | |||
| separator | , | , | ||||
| separate rows, supress output | ; | ; | ||||
| ellipsis | ... | |||||
| equal | = | = | ||||
| capture error | === | lasterr, & try, catch | ||||
| delineate string | " | " | ||||
| insert double quote in string | "" | " | MATLAB needs two single quotes ('') to insert a single quote into a string | |||
| comment | # | % | ||||
| block comments | #{..}# | NONE | ||||
| root Xmath directory | $XMATH | $MATLAB | ||||
| last command recall | @ | Command History Window | ||||
| run command | @num | Double click command in Command History Window | ||||
| run commands | @num:p | Highlight and run commands from Command History | ||||
| execute the most recent command starting with "str" | @str | Type str, then Up-arrow | ||||
| list all commands starting with "str" | @str:l | Command History Window | ||||
| list the most recent command starting with "str" | @str:p | Command History Window | ||||
| list all commands | @:l | Command History Window | ||||
| execute the most recent command | @@ | Up-arrow, then Enter | ||||
| list the most recent command | @@:p | Up-arrow, then Enter |
*The RealSim product line comprises both software and hardware components. The MathWorks xPC Target includes software only.
Store