Filter löschen
Filter löschen

Which workspace do Live Scripts use?

10 Ansichten (letzte 30 Tage)
Matthias
Matthias am 7 Apr. 2016
Kommentiert: Jared MacDonald am 17 Mär. 2017
Hi,
I'm just starting to use Live Scripts, but I don't understand how they interact with the base workspace of Matlab.
I can't seem to access variables in the base workspace from a Live Script, and I can't access Live Script variables from the command line. What's the recommended way to get data in and out of a Live Script?
Also, not all output works in Live Scripts. For example, executing fprintf('test') will not yield any output. Is that a bug or should I use other means to print to the Live Script output?
Thanks!
Edit: I just figured out that the workspace access does work, but only when you're not in debug mode. The printing question still stands.
  2 Kommentare
sam0037
sam0037 am 11 Apr. 2016
Hi,
I was not able to reproduce the printing issue at my end. This works fine at my end.See attached image where 'test' is shown as an output of the command 'fprintf('test'). Please share the code or elaborate more on the steps to reproduce this issue.
Additionally, follow the link below to know more about creating live scripts:
Jared MacDonald
Jared MacDonald am 17 Mär. 2017
Hi Matthias,
Live scripts use the MATLAB base workspace, just as traditional scripts do. So using "load," for example, will load data into variables in the base workspace.
If you close and re-open a live script, or restart MATLAB, you will need to re-run the live script to have the variables recreated. Perhaps this is what you were encountering?
I also was unable to reproduce an issue with fprintf().
Thanks, Jared

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Live Scripts and Functions finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by