필터 지우기
필터 지우기

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?

조회 수: 2 (최근 30일)
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
John D'Errico
John D'Errico 2017년 4월 2일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Varun Gunda
Varun Gunda 2017년 4월 6일
편집: Varun Gunda 2017년 4월 6일
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')
  댓글 수: 1
ShelroyRony
ShelroyRony 2024년 6월 18일
% Load data from Excel file filename = 'loading_data.xlsx'; % Name of the Excel file data = readtable(filename);
% Extract data from the table force = data.Force; % Force (in Newtons or appropriate units) deformation = data.Deformation; % Deformation (in mm or appropriate units)
% Create the plot figure; plot(deformation, force, 'o-', 'LineWidth', 1.5, 'MarkerSize', 8); hold on;
% Add labels and title xlabel('Deformation (mm)', 'FontSize', 12); ylabel('Force (N)', 'FontSize', 12); title('Force vs. Deformation', 'FontSize', 14); grid on;
% Add legend legend('Force vs. Deformation', 'Location', 'best');
% Adjust axes for better visualization set(gca, 'FontSize', 12);
% Show the plot1 hold off;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by