Skip to content

messenger / ZMQ session error upon "Matlab clear all" using 'magic'  #70

@bs448c

Description

@bs448c

As outlined in #56 and #69 I manage to build pymatbridge-0.3-dev under WIndows 8.1 64 bit. I can start the matlabserver and pass back and forth variables between MATLAB and my iPython notebook (Anaconda 1.9.1, Python 2.7.6) using 'magic' (the x=x+1 and a=[1,2,3]

%%matlab -i a -o b,c
b = a + 3
c = b + 3

sort of examples)

However when trying to port a more complex example,

%%matlab -o x,xf

%Author: Osama Ullah Khan,
%        Phd Student, University of Michigan-Ann Arbor.
%        Email: oukhan@umich.edu
%        Version: 1.0
%
%This code demonstrate compressive sensing example. In this
%example the signal is sparse in frequency domain and random samples
%are taken in time domain.

close all;
clear all;

%setup path for the subdirectories of l1magic
path(path, 'C:\MATLAB\R2013a\l1magic\Optimization');
path(path, 'C:\MATLAB\R2013a\l1magic\Data');


%length of the signal
N=1024;

%Number of random observations to take
K=256;

%Discrete frequency of two sinusoids in the input signal
k1=29;
k2=59;
k3=109;

n=0:N-1;

%Sparse signal in frequency domain.
x=sin(2*pi*(k1/N)*n)+sin(2*pi*(k2/N)*n)+sin(2*pi*(k3/N)*n);

xf=abs(fft(x));

my matlabserver fails:

MATLAB is running in headless mode.  Figure windows will not be displayed.

To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.

Socket created at: tcp://127.0.0.1:55555
Error using messenger
Error: ZMQ session not initialized

Error in matlabserver (line 30)
            messenger('respond', resp);

» 

I'd like to point out this exact snippet has been working flawlessly using pymatbridge-0.2 and the 'old' communication protocol.

I don't know if this is an issue of Windows or my build -- can pelase someone on a different OS try to replicate this behaviour?
Thanks!

EDIT: This seems to be due to the clear all; which seems to kill the matlabserver. I modified the issue title accordingly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions