Use the function command to open a vff. file

2 visualizaciones (últimos 30 días)
parslee
parslee el 12 de Feb. de 2024
Respondida: Austin M. Weber el 12 de Feb. de 2024
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 comentario
Les Beckham
Les Beckham el 12 de Feb. de 2024
Editada: Les Beckham el 12 de Feb. de 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

Iniciar sesión para comentar.

Respuestas (1)

Austin M. Weber
Austin M. Weber el 12 de Feb. de 2024
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.

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by