Ansys Learning Forum Forums Discuss Simulation General Mechanical how to link between ansys workbench and matlab Reply To: how to link between ansys workbench and matlab

mashetty
Subscriber
I am not an expert in ansys workbench simulations, but i have done some ansys mechanical simulaiton using matlab. This is the work flow, that i have followed:
1.Generate input.dat in ANSYS Workbench. Export your input file as  input.dat using ansys mechancial.
 
2.Convert input.dat to input.txt.(Example) or 
Rename input.dat to input.txt.
 
3.Prepare MATLAB Script to Run ANSYS in Batch Mode
create a beam.m file in matlab using the command line
beam.m file start
%%
%%   Very very important
% %important is to use the same directory of the inpt file we are working ,
%that input file and output file, current beam.m and current matlab directory everthing should in same directory
 
!"C:\Program Files\ANSYS Inc\v241\ansys\bin\winx64\ANSYS241.exe" -b -i beam.txt -o beamout.txt
beam.m file ends 
first is the path to the ANSYS executable file. It specifies the location of the ANSYS program that you want to run. 
-b indicates the batch mode of ansys
-i indicates the input file and then write the name of the input file.
-o indicates the output file and then write the name of the output file.
 
4. Now run the matlab file and simulation runs in batch mode and output and result files are genearted, which can again be opened in ansys mechanical for visualization.
 
5.Modify Input Parameters:
To change the force input, material properties, or boundary conditions, edit the relevant lines in the input.txt file.
After making the necessary changes, rerun the simulation using the beam.m script in MATLAB.
 
I hope this helps.