- Join over
**1.5M+ people** - Join over
**100K+ communities** - Free
**without limits** - Create
**your own community**

- Apr 28 18:02pitrish commented #252
- Apr 28 18:01pitrish commented #253
- Apr 28 18:00pitrish commented #253
- Apr 14 18:45DeepGravity commented #123
- Feb 07 17:34SirBenedick commented #246
- Feb 06 19:57SirBenedick commented #246
- Nov 21 2019 17:00lrq3000 commented #242
- Nov 21 2019 16:57lrq3000 commented #242
- May 15 2019 18:12AhmadChaiban commented #220
- Apr 30 2019 10:58sh3raawii closed #256
- Apr 24 2019 04:36lrq3000 opened #260
- Apr 24 2019 04:32lrq3000 commented #239
- Apr 24 2019 04:22lrq3000 commented #256
- Mar 15 2019 02:40happyalfred2016 commented #227
- Jan 17 2019 13:00reinout91 commented #131
- Jul 31 2018 13:14
arokem on master

Update README.md Including REA… Merge pull request #259 from ma… (compare)

- Jul 31 2018 13:14arokem closed #259
- Jul 31 2018 13:14arokem commented #259
- Jul 31 2018 01:36mateusz-was opened #259
- Jun 24 2018 14:39matthias-k commented #255

I was wondering as to how the test cases for this is written. Since it's an iPython binding, how do you check / write test cases for these extensions?

I'm working on Vispy, and I'm trying to write iPython extensions for it. I wasn't sure as to how you test it

These are the tests for the IPython magic: https://github.com/arokem/python-matlab-bridge/blob/master/pymatbridge/tests/test_magic.py

oh, thanks!

whoa, that's of *great* help. Thanks a lot :)

happy to help!

Let us know how you get on!

I usually use it to write small matlab scripts in the notebook (as a kernel, using https://pypi.python.org/pypi/matlab_kernel). I'd actually be curious to know what others are doing with this, so hoping that more people will answer your question

Hi,

I was trying the octave integration, but after successfully installed pymatbridge and connected Octave with

```
from pymatbridge import Octave
octave = Octave()
octave.start()
Starting Octave on ZMQ socket ipc:///tmp/pymatbridge-ad728a8c-93d8-4f42-9395-822a9a2b3bdf
Send 'exit' command to kill the server
.Octave started and connected!
Out[1]:
<pymatbridge.pymatbridge.Octave at 0x7f3b94668b50>
```

then I wasn't able to start the matlab magic integration `%load_ext pymatbridge`

, it start to look for matlab installation which it doesn't exist.

do you have any idea how to make it works

Thanks a lot

@LukasDrude actually I don't have matlab installed in the machine

@arokem I've tried

@arokem I've tried

`%load_ext pymatbridge executable='/usr/bin/octave'`

but it kept failing: http://nbviewer.ipython.org/github/yassinebha/tmp_pymatbridge/blob/master/pymatbridge_test.ipynb
Could you please try

`matlab='/usr/bin/octave'`

instead of `exectuable=...`

?

the docker image is ready to pull:

- Pull the image
`docker pull yassinebha/niak_notebook_test`

- Create a shared folder in you home directory
`mkdir $HOME/notebooks`

- Run the image

`docker run --name notebook_test -d -p 443:8888 -v $HOME/notebooks/:/notebooks -e "PASSWORD=password" yassinebha/ipython_notebook:0.0.1`

- Head to your browser then type https://localhost then over pass warning message then type the password which is
`password`

in this case ( you can choose your own ). On OSX and Windows, extra steps are required to find the address and the port that the container has been forwarded to. In a Boot2Docker shell, run:

`boot2docker ip`

This should return an address like 192.168.59.103. Next, find the port in the docker environment with:`docker port notebook_test 8888`

. This should return a port like 0.0.0.0.:443.

Port your browser to the resulting address and port; for example: https://192.168.59.103:443.Open a new ipython notebook then

**choose python 2 not 3 as kernel**- In the first cell put this code to start octave interfacing:

```
from pymatbridge import Octave
octave = Octave()
octave.start()
%load_ext pymatbridge
```

Ok, I think that is within a Python kernel. You can start a dedicated Matlab/Octave kernel (https://pypi.python.org/pypi/matlab_kernel) which is based on python-matlab-bridge.

In python

I am using mammographic images

**Pymatbridge ERROR: 'numpy.ndarray' object has no attribute 'todok'**

Hello

I'm trying to use a Cobra toolbox (in matlab code) in Jupyter Python notebook.

But I have an error using pymatbrigde.

I can connect matlab using magic command

```
%load_ext pymatbridge
Starting MATLAB on ZMQ socket ipc:///tmp/pymatbridge-b2ebed23-7ab3-4368-8fec-652a366b03b5
Send 'exit' command to kill the server
...........MATLAB started and connected!
```

I also can read a model test:

```
import cobra.test
m = cobra.test.create_test_model("textbook")
```

But **model_to_pymatbridge** doesn't work, and I can't parse the matlab model object to python format.

```
from cobra.io.mat import model_to_pymatbridge
model_to_pymatbridge(model, variable_name="modelTest")
```

AttributeError Traceback (most recent call last)

<ipython-input-11-dd83acd3bd47> in <module>()

1 from cobra.io.mat import model_to_pymatbridge

----> 2 model_to_pymatbridge(m, variable_name="model")

/home/user/anaconda2/lib/python2.7/site-packages/cobra/io/mat.pyc in model_to_pymatbridge(model, variable_name, matlab)

288 matlab = get_ipython().magics_manager.registry["MatlabMagics"].Matlab

289 model_info = create_mat_dict(model)**--> 290 S = model_info["S"].todok()**

291 model_info["S"] = 0

292 temp_S_name = "cobra_pymatbridge*temp*" + uuid4().hex

**AttributeError: 'numpy.ndarray' object has no attribute 'todok'**

I will be grateful for any help you can provide.

Thank you in advance for your time.