How to run a mat file only after the others have run

1 ビュー (過去 30 日間)
Alexandra
Alexandra 2016 年 11 月 8 日
編集済み: Alexandra 2016 年 11 月 8 日
Hi,
I have 4/5 matlab windows open and I run several independent mat files at the same time. When they finish I have another mat file which loads the data files saved by the others and computes an overall view. I start that code when I realize the others have finished but can I set this code to run automatically after the other files?
Hope I was clear.
Thanks a lot.
  1 件のコメント
Alexandra
Alexandra 2016 年 11 月 8 日
The other thing I wanted to do was to start all over again running the models to add a different simulation saved with another data file name after that final code runs. Basically to run those several windowns on a loop so as to have several simulations during the night.

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

回答 (1 件)

KSSV
KSSV 2016 年 11 月 8 日
YOu have to run a loop for all the files, do the operations and save them back.
F = dir('*.mat'); % get all mat files in the present folder
for ii = 1:length(F)
Fii = F(ii).name; % present file name
%%load the file
%%do what ever you want
end
  1 件のコメント
Alexandra
Alexandra 2016 年 11 月 8 日
編集済み: Alexandra 2016 年 11 月 8 日
Sorry, I am lost. Can I run the 5 independent files at the same time (to save time) and in the end run the last one only when the others finish, save the results and start running the 5 files at the same time again saving the results with a different name and run the final file again? I reall don't have a lot of experience commanding scripts.

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

カテゴリ

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by