Use the function command to open a vff. file
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Les Beckham
am 12 Feb. 2024
Bearbeitet: Les Beckham
am 12 Feb. 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
Antworten (1)
Austin M. Weber
am 12 Feb. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!