Use the function command to open a vff. file
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm trying to open a vff file on Matlab using a vff reader I found on File Exchange, but I'm not sure how to use the function command.
This is what I have:
function im = uigetfile('*.vff','Gel1.vff');
Thank you!
1 commentaire
Les Beckham
le 12 Fév 2024
Modifié(e) : Les Beckham
le 12 Fév 2024
That line of code appears to redefine the built-in uigetfile function which you definitely don't want to do, especially if you plan to use that built-in function. You should probably read the documentation on how to create and use Functions in Matlab. Note that uigetfile only returns the name and, optionally, the path to a user selected file. It doesn't actually open that file.
Also, if you are just getting started with Matlab, I would highly recommend that you take a couple of hours to go through the free online tutorial: Matlab Onramp
Réponses (1)
Austin M. Weber
le 12 Fév 2024
Hi @parslee
The File Exchange function (vff3D.m) in the link that you provided does not have very good documentation. Ideally, you should be able to type
help vff3D
in the command window and it will output directions on how to use the function, but the way the function file is written prevents help from actually being helpful.
That said, I went through the code for the File Exchange function and, theoretically, it should be very straightforward to use. You do not need to write uigetfile to import your .vff file. The uigetfile command is already integrated into the function from the File Exchange.
As long as you downloaded vff3D.m and the function is stored on your current MATLAB search path, you should be able to simply type:
im = vff3D
into your code and click run. The vff3D function will automatically open up the file explorer on your computer. All you need to do then is navigate to your .vff file and select it. If the vff3D function works properly, it should automatically import your file into MATLAB as the variable im.
0 commentaires
Voir également
Catégories
En savoir plus sur Data Import and Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!