Using strcmp to find data location in xls spreadsheets

2 visualizaciones (últimos 30 días)
Mary
Mary el 25 de Jun. de 2013
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

Respuestas (0)

Categorías

Más información sobre Data Export to MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by