Is there a way to send a list of variables from a function (global) to a workspace (local). I need to save them as numeric data type double, and not string, but I can convert if I can get them into a string

1 回表示 (過去 30 日間)
kbl
  2 件のコメント
KSSV
KSSV 2017 年 11 月 17 日
If a variable is global, it is already in workspace......for the other part..it is not clear...show us your code.
Stephen23
Stephen23 2017 年 11 月 17 日
"Is there a way to send a list of variables from a function (global) to a workspace (local)."
Sounds strange. Why not just pass the values using more standard, reliable, and efficient paradigms, e.g. passing arguments or nested functions?
You might like to read this:

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 11 月 17 日
  • There are methods to send a value into an already-executing function if you are using the Parallel Processing Toolbox
  • You could use one of the File Exchange contributions to serialize the variables into text, and use the Instrument Control Toolbox to send them into the already-executing function using tcp or udp, which would then deserialize them. The already-executing function would need to actively check for the packets. However, in order to escape from execution of the already-executing function in order to do the sending, you would need to have arranged that a callback be executed, such as a timer.
  • You could attach the variables to UserData or application data to a graphics object that the already-executing function knew to check. The already-executing function would need to actively check for the updates. However, in order to escape from execution of the already-executing function in order to do the sending, you would need to have arranged that a callback be executed, such as a timer.
But probably you need something different than these.

カテゴリ

Help Center および File ExchangeStandard File Formats についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by