How to run two MATLAB scripts simultaneously without open two different GUI windows

the following code can only run two different m files one by one. how can I run them simultaneously withou open two different GUI windows.
clc;clear all;
run C:\Users\asus\Desktop\try\8\tri.m
run C:\Users\asus\Desktop\try\16\tri.m

回答 (1 件)

José-Luis
José-Luis 2017 年 1 月 4 日

0 投票

If you have the parallel computing toolbox, you could use parpool.

4 件のコメント

Achintya  Sarkar
Achintya Sarkar 2017 年 10 月 6 日
can u please elaborate it, how to use parpool to run 2 script files simultaneously
Mallikarjun Bangi
Mallikarjun Bangi 2017 年 10 月 6 日
how to use parpool to run 2 script files, like test1.m and test2.m
parpool(2)
parfor idx = 1 : 2
if idx == 1
test1();
elseif idx == 2
test2();
end
end
Note: It is not possible to draw on the screen from any script or function run by parfor or spmd or parfeval or batch. Only non-parallel routines can draw on the screen.
Neel Talati
Neel Talati 2018 年 10 月 15 日
編集済み: Neel Talati 2018 年 10 月 15 日
Hello,
I am in a similar situation where I need to run two functions simultaneously namely func1 and func2. However I need func1 to make a plot based on some data coming on the serial port into func2.
For the purpose of this question let's assume it is not possible for me in any way to merge the two functions into one.
Please recommend how can I share the data between the two functions as well as plot a figure?
Thanks!
Neel

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

カテゴリ

ヘルプ センター および File ExchangeParallel Computing Fundamentals についてさらに検索

質問済み:

2017 年 1 月 4 日

編集済み:

2018 年 10 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by