Skip to content

Commit c2bea69

Browse files
committed
readme
1 parent 32e6628 commit c2bea69

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@
1414
.idea/.name
1515

1616
.DS_Store
17+
18+
ADME.markdown

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,38 @@ Unlike other interfaces, MATLAB only has to start once. All communication is don
77
## Usage
88

99
Initialize the Matlab class. You must pass in your matlab executable, e.g.
10+
1011
mlab = Matlab(matlab='/Applications/MATLAB_R2011a.app/bin/matlab')
1112

1213
By default the host is localhost and the port is 4000. This can be changed, e.g.
14+
1315
mlab = Matlab(matlab='/Applications/MATLAB_R2011a.app/bin/matlab',
1416
host='192.168.0.1', port=5151)
1517

1618
You must then start the MATLAB server:
19+
1720
mlab.start()
21+
1822
which will return True once connected.
1923

2024
You can then run any local MATLAB function contained within a .m file of the same name. For example, to call the function jk in jk.m:
21-
$ %% MATLAB
25+
26+
%% MATLAB
2227
function lol = jk(args)
2328
arg1 = args.arg1;
2429
arg2 = args.arg2;
2530
lol = arg1 + arg2;
2631
end
32+
2733
by calling:
34+
2835
res = mlab.run('path/to/jk.m', {'arg1': 3, 'arg2', 5})
2936
print res['result']
37+
3038
which will print 8.
3139

3240
You can shut down the MATLAB server by calling
41+
3342
mlab.stop()
3443

3544
NB: you can call MATLAB code before the server starts by adding code to the ./matlab/startup.m file.

0 commit comments

Comments
 (0)