Matlab prevents external program from accessing a file when Matlab script is running

3 visualizzazioni (ultimi 30 giorni)
Hello,
I am controlling Altair Hypermesh (FEA Program) using MATLAB . My workflow consists of initializing tcl scripts using the command prompt called by MATLAB. The command prompt will open Hypermesh and start the tcl script. One of the tcl scripts that I wrote uploads a file into Hypermesh (.fem file), which was previously edited with MATLAB. However, there is an error in Hypermesh which says that the file does not exist (but it does). This error only occurs if MATLAB is running a script. The .fem file is able to be manually uploaded with no errors only if MATALAB has stopped running.
I believe that the problem has something to do with MATLAB preventing Hypermesh from accessing the .fem file. The function fclose('all') was used to close all files but this does not solve the problem.
Is the source of the problem MATLAB or Hypermesh? My computer is Windows 10 Home edition, so perhaps it is an OS problem?
It would be great if I could receive any advice or solutions.
Thank you
  15 Commenti
Eric Trudel
Eric Trudel il 21 Set 2018
Alright, turns out the problem was that the working directory changed when I called Hypermesh from MATLAB (went to C:/Windows/System32 not C:/Users/e-tru/Documents ). So I had to change my working directory through my tcl script to C:/Users/e-tru/Documents. Now the script works as intended.
Thank you dpb and OCDER for your help.
Adeline War
Adeline War il 10 Mar 2022
Eric Trudel may I get your help in making a batch process between Matlab and HYpermesh?

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Manage Products in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by