Borrar filtros
Borrar filtros

How to run multiple Matlab (Linux) scripts in other directories?

7 visualizaciones (últimos 30 días)
Yro
Yro el 8 de Abr. de 2022
Respondida: Yro el 8 de Abr. de 2022
Hi, I need to run multiple matlab script out of scritp path. I have tried to generate the following bash script using the parallel command:
#!/bin/sh
path=$(echo $HOME/Test/{R1,R2,R3,R4,R5,R6,R7,R8,R9}/TS_version2/run_matlab.sh)
parallel -j0 sh ::: $path
With that script I want to run nine matlab scripts, the bash script is as follows:
#!/bin/sh
matlab -batch "run(fullfile(pwd,'Main.m'))"
The nine directories are well generated, the problem is that the Main.m script is not in the current matlab folder. How can I go to each directory or run the main script from another location?
Thanks in advance.
Kind regards.

Respuesta aceptada

Yro
Yro el 8 de Abr. de 2022
In case you are interested, this line of code worked.
parallel -j0 'cd {//} && sh {/}' ::: $path

Más respuestas (0)

Categorías

Más información sobre C Shared Library Integration en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by