Installing cvx on MATLAB 2015 b - matlab

I want install cvx on MATLAB 2015b. I followed the steps given on Matlab cvx error with cvx_begin.
However, I get following error
enter >> cd('C:\cvx')
cvx_setup
CVX: Software for Disciplined Convex Programming (c)2014 CVX Research
Version 2.1, Build 1110 (66e9a9c) Wed Jun 10 21:43:38 2015
Installation info:
Path: C:\cvx
MATLAB version: 8.6 (R2015b)
OS: Windows 7 x86 version 6.1
Java version: 1.7.0_60
Verfying CVX directory contents:
No missing files.
Preferences: none found; defaults loaded.
Setting CVX paths...done.
Saving updated path...
UNEXPECTED ERROR: ------------------------------------------------
Error using cd
Cannot CD to C:\Users\NIT2\AppData\Local\Temp (Name is nonexistent
or not a directory).
Error in tempdir (line 30)
curr_dir = cd(tmp_dir);
Error in tempname (line 17)
dirname = tempdir;
Error in savepath>iFopenTempLocation (line 274)
name = tempname;
Error in savepath (line 158)
[ fid, tempfilename ] = iFopenTempLocation( );
Error in cvx_setup (line 38)
stat = savepath;
------------------------------------------------------------------
Please report this error to support, and include entire output of
CVX_SETUP in your support request.
---------------------------------------------------------------------------de here

I used Run As Administrator for MATLAB and could so

Related

Why am I getting errors when I try to run the "Normalized cuts" demo?

I am trying to use the normalized cuts package from [http://www.cis.upenn.edu/~jshi/software/Ncut_9.zip][1] (on Windows 7 - MATLAB R2010a 32 bits), but it's not working. I'm trying to run the demo called "Ncut Clustering demo" and I got the following error:
??? Undefined function or method 'sparsifyc' for input arguments of type 'double'.
Error in ==> ncut at 41
W = sparsifyc(W,dataNcut.valeurMin);
Error in ==> ncutW at 9
[NcutEigenvectors,NcutEigenvalues] = ncut(W,nbcluster);
Error in ==> demoNcutClustering at 27
[NcutDiscrete,NcutEigenvectors,NcutEigenvalues] = ncutW(W,nbCluster);
I already put the NCUT9 dir in the path so this is not the problem I guess, and I already compile the MEX files with the command: compileDir_simple(mydir).

I have some issue during adding VLFEAT to MATLAB 7.10.0 (R2010a)

My malab installation folder is
C:\Program Files\MATLAB\R2010a\bin\matlab.exe
and I have added vlfeat to my current user folder:
C:\Users\Patrick\Documents\MATLAB\vlfeat-0.9.18\toolbox\vl_setup
I have created a startup file startup.m in this location
C:\Users\Patrick\Documents\MATLAB\startup.m
where I have added a command line
run('C:\Users\Patrick\Documents\MATLAB\vlfeat-0.9.18\toolbox\vl_setup')
but when I try to use its feature in another deafautnamefile.m and use some command like:
I = vl_impattern('roofs1') ;
image(I) ;
I = single(rgb2gray(I)) ;
[f,d] = vl_sift(I) ;
it gives the following error:
Invalid MEX-file 'C:\Program Files\MATLAB\vlfeat-0.9.18-bin\vlfeat-0.9.18\toolbox\mex\mexw32\vl_sift.mexw32': The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
Error in ==> sf at 4
[f,d] = vl_sift(I) ;
How can I resolve this?

Ghostscript error with print function in Matlab

I am trying to save images in Matlab by using the print function:
myImage = magic(500);
myFigure = figure('visible','off');
r = 1;
set(myFigure, 'PaperUnits', 'inches', 'PaperPosition', [0 0 1920 1080]/r);
% the program works fine on both computers without the line above
% however, the program runs fine on one computer only with this line
imagesc(myImage); axis image;
print(myFigure, '-dpng', sprintf('-r%d',r), 'myOutput.png');
When I run this program locally with Matlab R2012b, it works as expected. However, if I try to run it on a remote machine with Matlab R2011b, I get the following error message:
Error using ghostscript (line 188)
Problem converting PostScript. System returned error: -1.Failed to convert to
output format; Ghostscript status: -100.**** Unable to open the initial device,
quitting.
and the following error which is triggered by the line with the call to print():
Error in print>LocalPrint (line 311)
pj = ghostscript( pj );
Error in print (line 237)
LocalPrint(pj);
The code is more specifically:
if pj.GhostDriver
pj = ghostscript( pj );
elseif strcmp( pj.Driver, 'hpgl' )
hpgl( pj );
end
On my laptop, pj.GhostDriver is '' and pj.Driver is png.
One possible explanation is that I can launch ghostscript locally from the terminal:
$ ghostscript
GPL Ghostscript 9.10 (2013-08-30)
Copyright (C) 2013 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>
but not remotely from the terminal (since I do not have any graphical interface on the remote computer):
$ ghostscript
GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GPL Ghostscript 9.05: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting.
I would have thought Matlab already knew about it, since I launch Matlab on both computers by using:
matlab -nosplash -nodesktop -singleCompThread
Moreover, this problem is easily fixed as far as the terminal is concerned by adding the following line to ~/.bashrc:
export GS_DEVICE=display
Any hint at a solution?

rtwintgt install

I type in Matlab command window rtwintgt -install and get the following error:
??? Undefined function or variable 'twintgt'. [sic]
ยป rtwintgt -install
You are going to install the Real-Time Windows Target kernel.
Do you want to proceed? [y] : y
??? Failed to copy the kernel to Windows system directory.
Access is denied.
Error in ==> C:\MATLABR11\toolbox\rtw\windows\private\rtwtinst.dll
Error in ==> C:\MATLABR11\toolbox\rtw\windows\rtwintgt.m (rtwt_setup)
On line 74 ==> reboot = rtwtinst('install', srcpath);
Error in ==> C:\MATLABR11\toolbox\rtw\windows\rtwintgt.m
On line 24 ==> rtwt_setup
What should I do? And is it important to install this file?
My problem is when I call a matlab function from a file in my code using (#myfunction),
I get error?
As suggested in the comments, check if you have admin rights on your machine as well as if your license includes the Real-Time Windows Target.

Converting MATLAB files to Octave

I have a series of experiments that were written for MATLAB, but recently we are trying to run them through Octave instead. I realize they are mostly compatible, but I have been running into a few problems, and none of the online FAQs or directions I have found have addressed these at all. It's complicated a bit because there are multiple .m files that interact; however, for now I am going to focus on the main program. Anyway, so when I try to run the file (MLP.m) through octave, I get the following errors in the Terminal window:
error: dir: expecting directory or filename to be a char array
error: called from:
error: /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/miscellaneous/dir.m at line 128, column 5
error: /Applications/MATLAB_R2008a/toolbox/psychoacoustics/MLParameters.m at line 86, column 7
error: /Applications/MATLAB_R2008a/toolbox/psychoacoustics/MLP.m at line 9, column 3
The lines it is referencing are as follows:
1)
d = dir([cd myslash 'Experiments_MLP' myslash '*.m']);
2)
s = MLParameters;
What about these lines is incompatible with Octave? I can't find anything online that indicates that these won't work.
After that, the Terminal window gives me this batch of nonsense:
dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /usr/X11R6/lib/libfontconfig.1.dylib
Reason: Incompatible library version: libfontconfig.1.dylib requires version 13.0.0 or later, but libfreetype.6.dylib provides version 10.0.0
dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /usr/X11R6/lib/libfontconfig.1.dylib
Reason: Incompatible library version: libfontconfig.1.dylib requires version 13.0.0 or later, but libfreetype.6.dylib provides version 10.0.0
/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot: line 71: 1077 Trace/BPT trap GNUTERM="${GNUTERM}" GNUPLOT_HOME="${GNUPLOT_HOME}" PATH="${PATH}" DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" HOME="${HOME}" GNUHELP="${GNUHELP}" DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}" GNUPLOT_PS_DIR="${GNUPLOT_PS_DIR}" DISPLAY="${DISPLAY}" GNUPLOT_DRIVER_DIR="${GNUPLOT_DRIVER_DIR}" "${ROOT}/bin/gnuplot-4.2.6" "$#"
/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot: line 71: 1083 Trace/BPT trap GNUTERM="${GNUTERM}" GNUPLOT_HOME="${GNUPLOT_HOME}" PATH="${PATH}" DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" HOME="${HOME}" GNUHELP="${GNUHELP}" DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}" GNUPLOT_PS_DIR="${GNUPLOT_PS_DIR}" DISPLAY="${DISPLAY}" GNUPLOT_DRIVER_DIR="${GNUPLOT_DRIVER_DIR}" "${ROOT}/bin/gnuplot-4.2.6" "$#"
error: you must have gnuplot installed to display graphics; if you have gnuplot installed in a non-standard location, see the 'gnuplot_binary' function
I have GNUPlot installed, and I checked the gnuplot_binary function, which didn't give me any answers. GNUPlot is installed in my /Applications directory, along with Octave itself. Why shouldn't this work? The README file that came with GNUPlot didn't indicate a special directory for it to be installed in. What about the the dyld library not loaded errors? Is that related to the GNUPlot problem, or is it something else?
Anyway, thanks for your help
I know you already solved your problem, but if you have problems again here are some links with basic information about the differences between Matlab and Octave:
Porting programs from Matlab to Octave
Differences between Octave and MATLAB
Addressing your first error, it's easier to explain with an example:
dirName = '/some/path'; %# base directory
filesPath = fullfile(dirName, 'MLP', '*.m'); %# full path string
d = dir(filesPath); %# expand/enumerate files
for i=1:numel(d)
disp( d(i).name )
end
You also could have built the path using string concatenation yourself:
%# '/some/path/MLP/*.m'
filesPath = [dirName filesep 'MLP' filesep '*.m'];
The above should work for both MATLAB and Octave