How to give input as a text and read the number corresponding to that text from the excel sheet
1 回表示 (過去 30 日間)
古いコメントを表示
Harsimranjot Grewal
2021 年 5 月 11 日
コメント済み: Harsimranjot Grewal
2021 年 5 月 12 日
Hello everyone, I am trying to write a code which takes an input argument in the form of the text from the user and then matlab find that word in the excel sheet and return the number corresponding to it.The excel file will be as follow:
Material name Material temprature
steel 212
zinc 300
** I have only put two materials but iit will be around 200 matrials in the real excel file
So, If i put the steel and it should return 212 but I not able to get it.Any help will be appreciated.Thank you
0 件のコメント
採用された回答
Monika Jaskolka
2021 年 5 月 11 日
編集済み: Monika Jaskolka
2021 年 5 月 11 日
data = readtable('Spreadsheet.xlsx');
entry = data(strcmp(data.MaterialName, 'zinc'), :);
entry.MaterialTemperature
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!