How can I "install" a function of file exchange in Matlab?
35 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I'm a new Matlab user and I have a simple question. I found some good Matlab functions in the file exchange, like http://www.mathworks.com/matlabcentral/fileexchange/38848-historical-value-at-risk
But I don't know how to "install" that package to Matlab? So that I can use it with typing the function name and e.g. find the description in the Help of Matlab.
Thanks for your help.
2 Commenti
Edin Michael
il 13 Giu 2018
Modificato: Stephen23
il 13 Giu 2018
I have a similar question. In the link given above there is no mat file. So how do I add the function to the directory.
Stephen23
il 13 Giu 2018
Modificato: Stephen23
il 13 Giu 2018
" In the link given above there is no mat file"
Why does that submission require a .mat file? The submission you linked to contains two Mfiles, neither of which appears to load any .mat file, so it is not clear why you expect a .mat file to be included with the submission.
In any case, to use it click the Download button (top right-hand corner), and then unzip onto the MATLAB Search Path (e.g. the current directory), and it is ready to be used (following its instructions and help).
Risposte (4)
Sean de Wolski
il 9 Gen 2013
You just have to make sure that the function is saved in a folder that is on the MATLAB path. You can add folders to the path using the pathtool. Simply type at the command line:
pathtool
8 Commenti
Walter Roberson
il 3 Ott 2018
You have to pass in the image data. The documentation says:
% Examples
% -------
% % Threshold MATLAB's grayscale example image
% imshow(bernsen(imread('eight.tif')));
%
% % Threshold the attached jpg image
% imshow(bernsen(rgb2gray(imread('image.jpg')), [93,93]));
%
That is, you have to have image data, perhaps produced by imread, and you pass that image data to bernsen(), and it returns back an image, which you can store or display.
Wayne King
il 9 Gen 2013
Modificato: Wayne King
il 9 Gen 2013
Create a folder on your machine called histvar and then unzip the contents of that zip file into that folder, then at the MATLAB command prompt enter
>> addpath 'c:\histvar'
or whatever the appropriate command for your operating system is. You can also use pathtool to get a GUI for adding the folder.
The above will add that folder to the MATLAB path so that MATLAB can find the functions.
If you successfully add the folder to the MATLAB path, you can enter
>>which computeHistoricalVaR
and you see the path to that M-file. You should then be able to copy and paste the following code into the command window.
load data
confidence_level = 0.95;
plot_flag = true;
figure
VAR_hist = computeHistoricalVaR(returns,confidence_level,plot_flag)
Azzi Abdelmalek
il 9 Gen 2013
click on download submission, you will download a zip file. After download, unzip your files then use them as matlab files
0 Commenti
Vedere anche
Categorie
Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!