@@ -35,35 +35,37 @@ def __init__(self, message=None):
3535class MatlabProcess (object ):
3636 """Communicate with Matlab through a subprocess.
3737
38- Parameters:
39- matlab_exec (str, optional) : Path to the Matlab executable.
40- Defaults to `matlab`.
41- ws_data (dict, optional) : Workspace data to be loaded at startup.
42- Defaults to an empty dict.
43- ws_filename (str, optional) : Filename for workspace storage.
44- Defaults to `'./workspace.mat'`.
45-
46- Examples:
47- >>> m = MatlabProcess()
48-
49- >>> m.start()
50- >>> m.write_value('a', 37)
51- >>> m.run_command('tf = isprime(a);')
52- >>> m.read_workspace()
53- >>> m.stop()
54- >>> print(m.ws_data)
55-
56- >>> m.write_value('a', 17)
57- >>> m.run_command('res = isprime(a);')
58- >>> m.read_value('res')
59- True
60-
61- >>> m.run_command('res = isprime(a);', ivars={'a': 17})
62- >>> m.read_value('res')
63- True
64-
65- >>> m.run_command('res = isprime(a);', ivars={'a': 17}, ovars={'res': None})
66- {'res': True}
38+ Parameters
39+ ----------
40+ matlab_exec : str, optional
41+ Path to the Matlab executable. Defaults to ``matlab``.
42+ ws_data : dict, optional
43+ Workspace data to be loaded at startup. Defaults to an empty dict.
44+ ws_filename : str, optional
45+ Filename for workspace storage. Defaults to ``'./workspace.mat'``.
46+
47+ Examples
48+ --------
49+ >>> m = MatlabProcess()
50+
51+ >>> m.start()
52+ >>> m.write_value('a', 37)
53+ >>> m.run_command('tf = isprime(a);')
54+ >>> m.read_workspace()
55+ >>> m.stop()
56+ >>> print(m.ws_data)
57+
58+ >>> m.write_value('a', 17)
59+ >>> m.run_command('res = isprime(a);')
60+ >>> m.read_value('res')
61+ True
62+
63+ >>> m.run_command('res = isprime(a);', ivars={'a': 17})
64+ >>> m.read_value('res')
65+ True
66+
67+ >>> m.run_command('res = isprime(a);', ivars={'a': 17}, ovars={'res': None})
68+ {'res': True}
6769
6870 """
6971
0 commit comments