-
Notifications
You must be signed in to change notification settings - Fork 96
Closed
Description
This does not work:
%%matlab
image = imread('../mp.tif');
matlab_F = fft2(image);
F = log(abs(fftshift(matlab_F)));
imshow(F);
It does work in console (but only with omitted -nodisplay):
$ /Applications/MATLAB_R2014b.app/bin/matlab -nodesktop
< M A T L A B (R) >
Copyright 1984-2014 The MathWorks, Inc.
R2014b (8.4.0.150421) 64-bit (maci64)
September 15, 2014
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
>> image = imread('../mp.tif');
>> matlab_F = fft2(image);
>> F = log(abs(fftshift(matlab_F)));
>> imshow(F, [min(F(:)), max(F(:))]);
Warning: Image is too big to fit on screen; displaying at 17%
> In initSize at 71
In imshow at 309
>> exit
$ /Applications/MATLAB_R2014b.app/bin/matlab -nodesktop -nodisplay
< M A T L A B (R) >
Copyright 1984-2014 The MathWorks, Inc.
R2014b (8.4.0.150421) 64-bit (maci64)
September 15, 2014
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
>> image = imread('../mp.tif');
>> matlab_F = fft2(image);
>> F = log(abs(fftshift(matlab_F)));
>> imshow(F, [min(F(:)), max(F(:))]);
Error using imshow (line 212)
IMSHOW unable to display image.
I've tried setting Matlab().startup_options to only -nodesktop
(matlab logo shows up, so startup_options are executed correctly), but the error is the same:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-4-ade840d015dc> in <module>()
----> 1 get_ipython().run_cell_magic(u'matlab', u'', u"image = imread('../mp.tif');\nmatlab_F = fft2(image);\nF = log(abs(fftshift(matlab_F)));\nimshow(F, [min(F(:)), max(F(:))]);")
/Users/arve/.virtualenvs/brew/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_cell_magic(self, magic_name, line, cell)
2160 magic_arg_s = self.var_expand(line, stack_depth)
2161 with self.builtin_trap:
-> 2162 result = fn(magic_arg_s, cell)
2163 return result
2164
/Users/arve/.virtualenvs/brew/lib/python2.7/site-packages/pymatbridge/matlab_magic.pyc in matlab(self, line, cell, local_ns)
/Users/arve/.virtualenvs/brew/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
191 # but it's overkill for just that one bit of state.
192 def magic_deco(arg):
--> 193 call = lambda f, *a, **k: f(*a, **k)
194
195 if callable(arg):
/Users/arve/.virtualenvs/brew/lib/python2.7/site-packages/pymatbridge/matlab_magic.pyc in matlab(self, line, cell, local_ns)
215 e_s += "\n-----------------------"
216 e_s += "\nAre you sure Matlab is started?"
--> 217 raise RuntimeError(e_s)
218
219
RuntimeError: There was an error running the code:
image = imread('../mp.tif');
matlab_F = fft2(image);
F = log(abs(fftshift(matlab_F)));
imshow(F, [min(F(:)), max(F(:))]);
-----------------------
Are you sure Matlab is started?
The matlab version is 2014b, and here are the running process:
/Applications/MATLAB_R2014b.app/bin/maci64/../../Contents/MacOS/MATLAB_maci64 -r warning('off','all');addpath(genpath('/Users/arve/.virtualenvs/brew/lib/python2.7/site-packages/pymatbridge/matlab'));warning('on', 'all');matlabserver('ipc:///tmp/pymatbridge');exit -nodesktop
Any ideas?
Metadata
Metadata
Assignees
Labels
No labels