How to execute script based on input data gotten from another script?

1 回表示 (過去 30 日間)
Sergey Dukman
Sergey Dukman 2015 年 9 月 27 日
コメント済み: Star Strider 2015 年 9 月 27 日
Hello! I have two scripts, and I want to execute the second one based on data gotten from the first one. How do I do this?
Regards, Sergey

採用された回答

Star Strider
Star Strider 2015 年 9 月 27 日
Assuming you don’t want to turn the second one into a function and pass data to it as arguments, the easiest way would be to save your data to a .mat file in your first script, then load it in your second script.
The load function reads your variables from the .mat file and puts them directly in your workspace just as you saved them originally. If you do not want those same variable names in the workspace of your second function (because they would overwrite existing variables with the same names), use load with an output argument. That way you can give the variables in the .mat file specific different names in the second script if you need to.
  2 件のコメント
Sergey Dukman
Sergey Dukman 2015 年 9 月 27 日
Thank you! I will try this method.
Regards, Sergey
Star Strider
Star Strider 2015 年 9 月 27 日
My pleasure!
Save the Polar Bears!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by