Transfering variables between Matlab Sessions

조회 수: 7 (최근 30일)
VINAYAK KARANDIKAR
VINAYAK KARANDIKAR 2019년 7월 7일
댓글: VINAYAK KARANDIKAR 2019년 7월 8일
I have a question regarding sessions.
I have a main file with input data
I have a script called sum
I have a script called diff
sum and diff are
run on two different sessions
how do i declare 2 inputs
in main and pass them to
sum and diff???
  댓글 수: 2
dpb
dpb 2019년 7월 7일
If not in same session, you'll have to write the results to be saved to disk (.mat files/save/load are good for this being simple to use) and then recall them when needed.
VINAYAK KARANDIKAR
VINAYAK KARANDIKAR 2019년 7월 7일
No the idea is to run two different scripts called sum and diff at the same time. Both will be called by main script. Thas the dea i want to implement for sure.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2019년 7월 7일
First of all, DO NOT name your scripts sum and diff because those are two very important built-in function names and you could run into trouble if you ever want to use the built-in functions.
Next, use save() to save variables to a .mat file, and load() to recall those variables from the file to a new session of that script or any other script.
  댓글 수: 9
Image Analyst
Image Analyst 2019년 7월 8일
Then why not just transfer things via .mat files?
I guess we don't understand and maybe if you call tech support they can suggest a solution.
VINAYAK KARANDIKAR
VINAYAK KARANDIKAR 2019년 7월 8일
Alright, .mat files then!!!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by