I have successfully ran macro code using MATLAB, and also written the code to get the result, but the this code is not working and saving result ( i have used VWRITE).
But when i run the code in APDL GUI it works properly.
I have solved the problem and It was not the problem of macro code.
when running system commands, the stack size is limited to 512k through an environment variable called KMP_STACKSIZE. It is possible to verify the existence and value of this environment variable by issuing the following command listing all the variables (in Windows):
>>System('SET')
(produces a list of all environment variables currently set...)
For ANSYS to be able to run, you need to increase the stack size before calling the ANSYS executable. You can do this by wrapping the ANSYS call in a batch script or you can do the following: