variable editor and live scripts

7 Ansichten (letzte 30 Tage)
David Jones
David Jones am 8 Aug. 2018
Kommentiert: Ameer Hamza am 9 Aug. 2018
I'd like to enter data in a variable editor and then incorporate that variable in a live script.
Is this possible? I would think it would be possible to generate variable defining code from the variable editor that I could then paste into a live script, but I can't figure out how.
  3 Kommentare
madhan ravi
madhan ravi am 9 Aug. 2018
Thank you @Stephen Cobeldick, will be really useful.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 9 Aug. 2018
If you want to generate a code to recreate a variable, then try following ways
  • Using command window
matlab.io.saveVariablesToScript(fileName, variableName);
filename and variable are both char arrays.
  • Right-click the variable in the Workspace window and click Save As. Then select m-file as target file option.
After creating these files, you can use the generated code to recreate variables with same values. However, this will only work for variables of small size. You can configure the maximum size of the variable from Preferences > Workspace.
  2 Kommentare
David Jones
David Jones am 9 Aug. 2018
Thank you!
Ameer Hamza
Ameer Hamza am 9 Aug. 2018
You are welcome.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by