MATLAB Answers

0

variable editor and live scripts

David Jones さんによって質問されました 2018 年 8 月 8 日
最新アクティビティ Ameer Hamza
さんによって コメントされました 2018 年 8 月 9 日
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 件のコメント

madhan ravi
2018 年 8 月 9 日
Variable editor -> you mean the normal script??
madhan ravi
2018 年 8 月 9 日
Thank you @Stephen Cobeldick, will be really useful.

サインイン to comment.

1 件の回答

Ameer Hamza
回答者: Ameer Hamza
2018 年 8 月 9 日
 採用された回答

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 件のコメント

David Jones 2018 年 8 月 9 日
Thank you!
Ameer Hamza
2018 年 8 月 9 日
You are welcome.

サインイン to comment.



Translated by