How to use a workspace variable in editor

11 visualizzazioni (ultimi 30 giorni)
Joaquin
Joaquin il 15 Feb 2011
I'm creating a function and I want to input a variable from my workspace in the function, with it being constant.
Is there a way I can "call" the variable from the workspace without having to define the variable at the beginning of the editor?
Thanks for your help
Joaquin

Risposte (2)

Paulo Silva
Paulo Silva il 15 Feb 2011
Why don't you supply that variable as argument for the function when you call the function from workspace?
MyFunction(MyConstantVariable)

Andreas Goser
Andreas Goser il 15 Feb 2011
I'd say you need to work with function arguments:
For the sake of completeness, the is also the EVALIN command, but I do not recommend it.

Categorie

Scopri di più su Workspace Variables and MAT Files in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by