Check and read different types of file types.
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vasiliki Thomopoulou
el 26 de Nov. de 2020
Comentada: Vasiliki Thomopoulou
el 26 de Nov. de 2020
Hey there. I want to make a program that will ask the user to import a file, and then the program will check if the file is .csv, if not it will check if it is .ods, if not it will check if it is .xls and will read it in all of these cases. If not it will print an error message and ask the user to import the file again. Do you have any idea? Even the slightest help would be great. Thank you vary much.
0 comentarios
Respuesta aceptada
Ameer Hamza
el 26 de Nov. de 2020
I am not sure about .ods, but MATLAB's readmatrix() is capable of importing .csv and .xls file. You don't need to tell MATLAB the type of file. It will automatically detect it based on the file extension.
You can use uigetfile() function to graphically prompt the user to select a file.
Más respuestas (0)
Ver también
Categorías
Más información sobre Large Files and Big Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!