We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cc2fa5 commit e5c6c46Copy full SHA for e5c6c46
examples/eval_m_file.py
@@ -0,0 +1,28 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+"""Evaluate m-file and collect the results.
4
5
+"""
6
+from __future__ import division, print_function, absolute_import
7
+from __future__ import unicode_literals
8
9
+__author__ = "Marek Rudnicki"
10
+__copyright__ = "Copyright 2014, Marek Rudnicki"
11
+__license__ = "GPLv3+"
12
13
14
+import matlab_wrapper
15
16
17
+def main():
18
+ matlab = matlab_wrapper.MatlabSession()
19
20
+ matlab.put('x', 2.)
21
+ matlab.eval('my_script')
22
+ y = matlab.get('y')
23
24
+ print("And the winner is:", y)
25
26
27
+if __name__ == "__main__":
28
+ main()
examples/my_script.m
@@ -0,0 +1,4 @@
+ % Basic MATLAB script
+y = x * 2;
0 commit comments