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

조회 수: 5 (최근 30일)
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
Eric Trudel
Eric Trudel 2018년 9월 21일
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 2022년 3월 10일
Eric Trudel may I get your help in making a batch process between Matlab and HYpermesh?

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by