提取excel行并获取另一列中的相应单词

我准备了一张有两列的excel表格。 英文单词第一列存储,第二列存储相应的马拉地语单词。 我想先在excel文件中search英文单词,如果单词可用,则获取其相应的马拉地语单词。 在matlab中的代码…

%%// Replace this with your XLS filepath FILE = 'list1.xls'; %%// Read raw data from xls file [~,~, rawdata] = xlsread(FILE); %%// English word to be translated to marathi. Replace this with your %%// english word english_word = 'yes'; %%// Compare the first column that is rawdata(:,1) against the english word %%// and returns a binary array with 1s where the match is found match = ismember(rawdata(:,1),english_word); %%// Use the binary array from above to use only the matching row and %%// return the second column of it, which is our much needed marathi word marathi_word = char(rawdata(match,2)) 

注意:使用xlsread的第二个输出参数也可以。