How to index match excel file in matlab
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to search for an value from an excel sheet and then display that value in matlab
For example,
I want to take input of speed and torque value in matlab
Read the excel file in matlab,
Then with respect to these value i want to search the corresponding value in the excel and return it into matlab.
For example, If I input speed 200 and the torque 20 it should return 62 in my matlab.(refer the excel sheet attached).
Thanks in advance.
0 Kommentare
Antworten (1)
Wan Ji
am 19 Aug. 2021
Bearbeitet: Wan Ji
am 19 Aug. 2021
You can do with following code
T = readtable('example.xlsx', ...
'ReadVariableNames', true,...
'PreserveVariableNames',true,...
'ReadRowNames', true); % read a table
%T('Row1',:) = []; % delete Row1, this line is only to remove unnecessary data
speed = '200';
torque = '20';
T{torque, speed} % get speed = '200' and torque = '20' table value
The result becomes:
ans =
62
0 Kommentare
Siehe auch
Kategorien
Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!