I have an excel file with multiple sheets and each sheet contains numbers and words. How can I upload the file so each sheet can be read and the values within it can be analyzed?

7 visualizaciones (últimos 30 días)
The excel sheets are recipes that contain a list of ingredients and the amount of that ingredient required for the recipe. We need to have these recipes uploaded to MATLAB so the program can read the content of the sheets. We are trying to create a program where a user can select the ingredients they have using checkboxes in a GUI and the program will display to the user which recipes they will be able to make using the ingredients they have. Ultimately, we would like to compare ingredients selected by checkboxes in a GUI to the ingredients in the recipes and determine what percentage of ingredients match.
  1 comentario
John D'Errico
John D'Errico el 2 de Abr. de 2017
I'd start by reading the help for xlsread, which allows you to specify the sheet you will be reading. Any more than that is impossible to answer, since only you know what is in the file and exactly what will be done with the result.
help xlsread

Iniciar sesión para comentar.

Respuesta aceptada

Varun Gunda
Varun Gunda el 6 de Abr. de 2017
Editada: Varun Gunda el 6 de Abr. de 2017
MATLAB function 'xlsread' will suit your use case. Check the documentation in following link.
Different options include:
num = xlsread(filename)
num = xlsread(filename,sheet)
num = xlsread(filename,xlRange)
num = xlsread(filename,sheet,xlRange)
num = xlsread(filename,sheet,xlRange,'basic')

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by