Assignments

An assignment stores the value(s) of an expression into a EXTREMA variable. An assignment has the form: `variable = expression` where `expression` is some combination of constants, variables, functions, and operators. For example:

     Y=A*COSD(X/10)+3.5*SIND(X/12)+C*EXP(-X)

The type of variable generated by an assignment is determined by the expression. If the right hand side of the assignment evaluates to a character string, the variable will be a character variable, while if it evaluates to a numeric value or values, the variable will be a numeric variable. In this case, the shape of the right hand side determines whether it is a scalar, vector or matrix. You can also mix numeric and character, in which case the result will be numeric. For example:

    A = 2
    B = 3
    T = 'A+B'
    C = 3*T

and `C` will be a numeric scalar variable with the value `15`.

Input is limited to `255` characters, so to have expressions that are longer, use character variables to store its pieces and the `EVALUATE` function to evaluate the expression numerically. For example:

    F1 = '2.5*COS(X/10)+3.5*SIN(X/12)+63.7*EXP(X/45)'
    F2 = '1.234567*MOD(X,100)+SIN(X/1000)*EXP(X/200)'
    F3 = '3.56789*X^2-2.34567*X+23.456'
    F = 'F1+F2+F3'
    Y = EVALUATE(F)

You can use the `EXPAND` function to expand all the parts of a string. For example, with the above variable definitions, `=EXPAND(F)` will display:

    (2.5*COS(X/10)+3.5*SIN(X/12)+63.7*EXP(X/45))+(1.234567*MOD(X,100)+SIN(X/1000)*EXP(X/200))+(3.56789*X^2-2.34567*X+23.456)

Expressions
String assignments