Where are matlab files stored which are given in documentation for trying out in browser - matlab

I have used try in browser features in matlab to run some code which are the part of documentation provided by matlab.
To explain this more simple, here is the link which lets users to try the matlab in browser.
I am trying to see those matlab files ( object3d.mat) in this case. But I cannot find any information about where are those files.
Is there anyway to download that file ('object3d.mat) ?

These mat-files come with MATLAB installation. If the MATLAB directory (including all sub-directories and files) is in your path (by default, it is) then you can use load to load it into your workspace i.e.
load object3d.mat
%or just: load object3d
If it is in your path, you can know its location using which i.e.
>> which object3d.mat
C:\Program Files\MATLAB\R2018a\toolbox\vision\visiondata\object3d.mat
>>
Note: Please make sure that you're reading the documentation of your installed MATLAB version and have the specific toolbox installed. If the documentation for the MATLAB version that you're using doesn't include that filename then it is likely that it is not available in that version.

Related

MATLAB cannot save changes to the path

When starting Matlab, I must now add new paths in order to get access to my functions. However, these paths cannot be saved, and I get the following message:
“MATLAB cannot save changes to the path.
The path file, pathdef.m, might be read-only or might be in a directory for which you do not have write access.
You can save pathdef.m to a different location. In order for MATLAB to use the pathdef.m in future sessions, you need to save it in your MATLAB startup directory (the directory from which you start MATLAB).
Do you want to save pathdef.m to another location?”
Before that, it works perfectly fine.
I tried the following solutions, but none of them did work:
restart the computer
restart Matlab
start Matlab as Administrator
re-install Matlab
re-install Matlab directly in C:\ (not in C:\Programs)
share Matlab-folders
check the number of „pathdef.m“ (and there is only one)
change UAC to the smallest level
try another license
The problem seems to be between Windows and Matlab. I have Windows 8.1 Pro (64-bit), and I used Matlab 2015a.
Any help to solve the problem would be much appreciated!

How to edit "mexopt.bat" file in Matlab?

I have Matlab R2014b and OpenCV 2.4, i have been trying to use ViolaJones Face Detection toolbox, but i have some troubles. I've searhced the problem and found a solution that suggest edit mexopt.bat file. What the real problem is here
The Matlab command
fullfile(prefdir, 'mexopts.bat')
returns
C:\Users\simit\AppData\Roaming\MathWorks\MATLAB\R2014b\mexopts.bat
but I can't find the file when I go to the path. How can I find the mexopts.bat file and edit it?
I have R2015b installed. I searched my computer for a mexopts.bat file, and found it in folders related to code I have from 2012-2013, but not in the new MATLAB install folder. For this reason I believe it's not a part of the standard MATLAB installation, which is probably why you didn't find it.
According to this thread it seems that the mexopts.bat file is no longer used in MATLAB starting R2014a, and instead you should look for these files:
mex_C_win32.xml
mex_C_win64.xml
MBUILD_C_win32.xml
MBUILD_C_win64.xml
If you are still convinced that you should find and edit a mexopts file, let me recommend you the Everything Search Engine to look for files on your hard-drive.

Is there anyway to make an executable compatible by using matlab mex?

The executable is created by using mex. Currently I tried it on windows, but eventually I will need it for windows, linux, and mac os x.
The problem is it can only be used with the same version of matlab which I used to create it.
The main reason I think is if different version of matlab is used, then the path for libraries used by the executable will be different.
Is there any way that I can create an executable from mex which can be compatible with different versions of matlab?
Is possible that I set paths for libraries and header files associated with multiple versions of matlab?
Please correct me if I understand anything wrong above. Thanks a lot.
More detail information:
The way to generate my executable is to call:
mex('-v', '-f', [matlabroot '\bin\win32\mexopts\msvc90engmatopts.bat'], 'myexecutable.cpp');
In the msvc90engmatopts.bat file, paths are set for librarires and header files and etc.
msvc90engmatopts.bat is from matlab.

Matlab and addpath

I have recently been working with Matlab. My question stems from my usage over a few months and is something that I can't seem to solve. I have an external SVM toolbox (OSU-SVM) that I would like to interface to with my project. I am able to get the entire system to work when I add the path of the toolbox manually (Right click -> Add to Path -> Selected Folders and Subfolders). What I would like to do is add the folder in a script. I've tried the "addpath" command but for some reason I can't get it to find the library relative to the m-file (script) that I run the command from. The following is an example of the code:
% Add OSU SVM system
addpath(genpath('./osu-svm/'));
The reason the I'd like to add the path using a relative folder to the M-file is that the code needs to run in a different environment that will not have the toolbox install. The code is also going to be executed in a different OS to the one I am developing on. That is, I am running a Windows Matlab to develop the code and need to run the finished system on a Linux machine. The process of running my files needs to be as painless as possible and shouldn't require much input from the user. That is why I'm specifically trying to avoid manual addition of the path.
On a side note a similar problem occurs when I wish to use "uigetfile" using a relative path. I believe there is something I am missing that will help me solve both of these simultaneously. Any help would be greatly appreciated.
Instead of './osu-svm/' alone use
fullfile('.','osu-svm')
The reason it does not work for you on windows is that you are using forward slash file separators. Full file will make a file string containing the correct file separator for each OS.
The genpath example in the matlab documentation also uses fullfile
http://www.mathworks.co.uk/help/techdoc/ref/genpath.html
Furthermore, the '.' is kinda unnecessary as it just means "relative to the current directory" and can be left out of the command. Perhaps you meant one directory up?
'..'
???

Extract .mat data without matlab - tried scilab unsuccessfully

I've downloaded a data set that I am interested in. However, it is in .mat format and I do not have access to Matlab.
I've done some googling and it says I can open it in SciLab.
I tried a few things, but I haven't found any good tutorials on this.
I did
fd = matfile_open("file.mat")
matfile_listvar(fd)
and that prints out the filename without the extension. I tried
var1 = matfile_varreadnext(fd)
and that just gives me "var1 = "
I don't really know how the data is organized. The repository described the data it contains, but not how it is organized.
So, my question is, what am I doing wrong in extracting/viewing this data? I'm not committed to SciLab, if there is a better tool for this I am open to that.
One options is to use Octave, which can read .mat files and run most Matlab .m files. Octave is open source with binaries available for Linux, Mac, and Windows. Inside of Octave you can load the file using:
load file
See Octave's manual section 14.1.3 Simple File I/O for more details.
In Scilab:
loadmatfile('file.mat');
(Source)
I had this same interest a few years back. I used this question as a guide. It uses Python and SciPy. There are options for NumPy and hd5f as well. Another option is to write your own reader for the .mat format in whatever language you need. Here is the link to the mat file format definition.