Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ad71d5

Browse files
committed
NOTEBOOKS.
1 parent 16405f8 commit 2ad71d5

File tree

2 files changed

+87
-13
lines changed

2 files changed

+87
-13
lines changed

matlab_magic.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
"collapsed": false,
341341
"input": [
342342
"%%matlab -i a -o b\n",
343-
"b = a + 3"
343+
"b = [a;a]"
344344
],
345345
"language": "python",
346346
"metadata": {},
@@ -351,12 +351,13 @@
351351
"\n",
352352
"b =\n",
353353
"\n",
354-
" 4 5 6\n",
354+
" 1 2 3\n",
355+
" 1 2 3\n",
355356
"\n"
356357
]
357358
}
358359
],
359-
"prompt_number": 6
360+
"prompt_number": 16
360361
},
361362
{
362363
"cell_type": "code",
@@ -369,13 +370,14 @@
369370
"outputs": [
370371
{
371372
"output_type": "pyout",
372-
"prompt_number": 7,
373+
"prompt_number": 17,
373374
"text": [
374-
"array([4, 5, 6])"
375+
"array([[1, 2, 3],\n",
376+
" [1, 2, 3]])"
375377
]
376378
}
377379
],
378-
"prompt_number": 7
380+
"prompt_number": 17
379381
},
380382
{
381383
"cell_type": "code",

pymatbridge.ipynb

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,63 @@
4343
"output_type": "stream",
4444
"stream": "stdout",
4545
"text": [
46-
"Starting MATLAB on http://localhost:59735\n"
46+
"Starting MATLAB on http://localhost:62161\n"
47+
]
48+
},
49+
{
50+
"output_type": "stream",
51+
"stream": "stdout",
52+
"text": [
53+
"."
54+
]
55+
},
56+
{
57+
"output_type": "stream",
58+
"stream": "stdout",
59+
"text": [
60+
"."
61+
]
62+
},
63+
{
64+
"output_type": "stream",
65+
"stream": "stdout",
66+
"text": [
67+
"."
68+
]
69+
},
70+
{
71+
"output_type": "stream",
72+
"stream": "stdout",
73+
"text": [
74+
"."
75+
]
76+
},
77+
{
78+
"output_type": "stream",
79+
"stream": "stdout",
80+
"text": [
81+
"."
82+
]
83+
},
84+
{
85+
"output_type": "stream",
86+
"stream": "stdout",
87+
"text": [
88+
"."
89+
]
90+
},
91+
{
92+
"output_type": "stream",
93+
"stream": "stdout",
94+
"text": [
95+
"."
96+
]
97+
},
98+
{
99+
"output_type": "stream",
100+
"stream": "stdout",
101+
"text": [
102+
"."
47103
]
48104
},
49105
{
@@ -303,13 +359,21 @@
303359
"res_dict = matlab.run_code('a=[1,3,7]')\n",
304360
"res_dict = matlab.run_code('plot(a)')\n",
305361
"res_dict = matlab.run_code('b=a+1')\n",
306-
"aa = matlab.get_variable('b')['var']\n",
307-
"aa"
362+
"exec('this=np.array(%s)'%matlab.get_variable('b')) \n",
363+
"this"
308364
],
309365
"language": "python",
310366
"metadata": {},
311-
"outputs": [],
312-
"prompt_number": "*"
367+
"outputs": [
368+
{
369+
"output_type": "pyout",
370+
"prompt_number": 3,
371+
"text": [
372+
"array([2, 4, 8])"
373+
]
374+
}
375+
],
376+
"prompt_number": 3
313377
},
314378
{
315379
"cell_type": "code",
@@ -390,13 +454,21 @@
390454
},
391455
{
392456
"output_type": "pyout",
393-
"prompt_number": 4,
457+
"prompt_number": 37,
394458
"text": [
395459
"True"
396460
]
397461
}
398462
],
399-
"prompt_number": 4
463+
"prompt_number": 37
464+
},
465+
{
466+
"cell_type": "code",
467+
"collapsed": false,
468+
"input": [],
469+
"language": "python",
470+
"metadata": {},
471+
"outputs": []
400472
}
401473
],
402474
"metadata": {}

0 commit comments

Comments
 (0)