Using strcmp to find data location in xls spreadsheets

3 ビュー (過去 30 日間)
Mary
Mary 2013 年 6 月 25 日
Hello!
I'm trying to run analysis on information in rows on a spreadsheet.
What I would like to do, is have the user input a vector of names as a string, and then pull those usernames and related rows of information from a separate xls spreadsheet
For example: I would type in Mary L and Matlab would return for me the location of the information about Mary L in the spreadsheet
For example
function makeReport
[num,txt,raw] = xlsread[spreadsheet]
x = input('Type Usernames','s'_
userNames = strcat(x)
a = 1
for i = numel(userNames)
user = userName (a)
strcmp(user,raw(:,1)
userlocation = row of username location
completedM = raw(6,userlocation)
completedB = raw(5, userlocation)
% run calculations
.
.
.
log(a,1) = user
log(a,2) = completedM
log(a,3) = completedB
...
a=a+1
end
xlswrite('Report',log,1)
end
also is there any way that a user can copy and paste a row of text as an input? For some reason when I do this it will not let me use string functions on the loaded string

回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by