Matlab assignin export Specifies workspace Evalin execute the specified workspace command

Source: Internet
Author: User

Assignin


Assign value to variable in specified workspace
Syntax


Assignin (WS, ' Var ', Val)

Description


Assignin (WS, ' Var ', Val) assigns the value Val to the variable var in the workspace ws. The Var input must is the array name only; It cannot contain array indices. If var does not exist in the specified workspace, Assignin creates it. WS can has a value of ' base ' or ' caller ' to denote the MATLAB base workspace or the workspace of the caller function.

The Assignin function is particularly useful for these tasks:

Exporting data from a function to the MATLAB workspace

Within a function, changing the value of a variable that's defined in the workspace of the caller function (such as a Var Iable in the function argument list)



Evalin


Execute MATLAB expression in specified workspace
Syntax


Evalin (WS, Expression)
[A1, A2, A3, ...] = Evalin (ws, Expression)

Description


Evalin (WS, expression) executes expression, a string containing any valid MATLAB expression, in the context of the WORKSPA Ce ws. WS can has a value of ' base ' or ' caller ' to denote the MATLAB base workspace or the workspace of the caller function. You can construct expression by concatenating substrings and variables inside square brackets:
expression = [string1, Int2str (Var), string2,...]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.