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

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?

Related

How to solve error on docker:layers_calculator to compute the Merkle tree on private tangle?

I want to setup a private tangle on my own virtual machine with Ubuntu 18.04, 4GB RAM and 20GB memory.
I have follow this instructions: https://docs.iota.org/docs/compass/0.1/how-to-guides/set-up-a-private-tangle. Every command works fine until reach this one: bazel run //docker:layers_calculator.
It shows an error as follows:
Starting local Bazel server and connecting to it...
ERROR: /home/istabraq/compass/third-party/maven_deps.bzl:3:5: Traceback (most recent call last):
File "/home/istabraq/compass/WORKSPACE", line 42
maven_jars()
File "/home/istabraq/compass/third-party/maven_deps.bzl", line 3, in maven_jars
native.maven_jar(<4 more arguments>)
type 'struct' has no method maven_jar()
ERROR: error loading package '': Encountered error while reading extension file 'protobuf_deps.bzl': no such package '#com_google_protobuf_deps//': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'protobuf_deps.bzl': no such package '#com_google_protobuf_deps//': error loading package 'external': Could not load //external package
INFO: Elapsed time: 4.743s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
How can I solve this problem? what I have missed?
read carefully the message given after running bazel installer:
Make sure you have "/home/yourusername/bin" in your path. You can also activate bash completion by adding the following line to your :
source /home/yourusername/.bazel/bin/bazel-complete.bash
You can check with: "bazel info" or "bazel version"
Unfortunately, there are further errors:
https://github.com/iotaledger/compass/issues/142
I have solve this issue by using this commands:
Step 3: Set up your environment
If you ran the Bazel installer with the --user flag as above, the Bazel executable is installed in your $HOME/bin directory. It’s a good idea to add this directory to your default paths, as follows:
export PATH="$PATH:$HOME/bin"
You can also add this command to your ~/.bashrc or ~/.zshrc file to make it permanent.
reference:
https://docs.bazel.build/versions/master/install-ubuntu.html

Opening grb2 files re-visited

I have downloaded and installed NCTOOLBOX into MATLAB (2013a) to read netcdf and grb files. As a test, I copied a netcdf, grb and grb2 file to a directory on my computer. This is placed within my script as:
pathnc = 'c:\test\era40_moda_200205.nc'
pathgrb = 'c:\test\era40_moda_200205.grb'
pathgrb2 = 'c:\test\multi_1.at_4m.dp.200607.grb2'
I used the following code to read the *.nc file:
nc = ncdataset(pathnc);
nc.variables
The code works great....with no error messages..and all variables listed..on netcdf files...... however, when I run it for the grb files using:
nc = ncdataset(pathgrb);
nc.variables
I get this very long list of errors:
2014-03-05 08:40:15,744 [main] WARN ucar.nc2.grib.grib2.Grib2Index - Grib2Index bad size = -1 for c:/test/multi_1.at_4m.dp.200607.grb2 index = c:\test\multi_1.at_4m.dp.200607.grb2.gbx9
Warning: Escape sequence '\m' is not valid. See 'help
sprintf' for valid escape sequences.
> In ncdataset>ncdataset.ncdataset at 89
In GRIB_and_NC_Reader_Prog at 14
Error using ncdataset (line 91)
Failed to open c: est
Error in GRIB_and_NC_Reader_Prog (line 14)
nc = ncdataset(pathgrb2);
Caused by:
Error using ncdataset (line 75)
Java exception occurred:
java.lang.RuntimeException: java.lang.NoSuchFieldError:
alwaysUseFieldBuilders...............etc, etc....ad nauseum...............
In case it was just a bad file, I tried the code on a different grb file and got the same results. Yes I have read the previous posts on reading grb with NCTOOLBOX...but still 'dead in the water.' I would greatly appreciate any insight to get my script reading grb and grb2 files.
I was getting a similar java error: java.lang.NoSuchFieldError:alwaysUseFieldBuilders. I tried running the same code in R2014a and it worked.

Why can't MATLAB deploytool output exe file?

deploytool works well until creating exe file using mbuild then get this error:
Executing command: mbuild -O -v -output "U1" -I"e:\Mat2009\work\ntst1\U1\src" "e:\Mat2009\work\ntst1\U1\src\U1_main.c" "e:\Mat2009\work\ntst1\U1\src\U1_delay_load.c" "e:\Mat2009\work\ntst1\U1\src\U1_mcc_component_data.c" -link exe -env MCR_DELAYLOAD=/delayload:mclmcrrt710.dll -env
MCR_DELAYLIB=delayimp.lib -outdir "e:\Mat2009\work\ntst1\U1\src"
Error: An error occurred while shelling out to mbuild (error code = -1).
Unable to build executable.
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).
How can I resolve this error?
This error looks similar to an error I encountered once (after upgrading to 2012b), I cannot recall the source but I found two potential solutions:
Make sure there are no spaces in the path to the compiler
Try building a few times and cross your fingers
Given the time frame I had I chose to go for option two and after 5-10 attempts it suprisingly worked.
have found that COMSPEC env. var had a wrong value, so I deleted the wrong path, restarted MATLAB then it worked well.

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