Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I used the exclamation mark command in Matlab, to execute the command that follows the exclamation mark, in the operating system. Also, alternatively, you can use the system command:

[status,result] = system('command') calls upon the operating system to execute the given command. The resulting status and standard output are returned.

In my case, i invoked python from within matlab by typing the following in an m-file:

! C:\Python27\python.exe dynamic_simulation.py

And in dynamic_simulation.py, i placed the following code at the beginning of the file:

import os,sys

PSSELOCATION = r'C:\Program Files\PTI\PSSE33\PSSBIN' sys.path.append(PSSELOCATION) os.environ['PATH'] = os.environ['PATH'] + ';' + PSSE_LOCATION

import psspy

import redirect redirect.psse2py();