Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Mary
Posts:
20
Registered:
12/7/10


Re: Problems with Strings!
Posted:
Jun 25, 2013 5:09 PM


dpb <none@non.net> wrote in message <kqcte3$jk7$1@speranza.aioe.org>... > On 6/25/2013 2:16 PM, Mary wrote: > ... > > I'm having two problems: > ... > > > (I'm hoping to allow the user to copy and paste a list of usernames from > > a word doc/spreadsheet, and paste them when prompted for an input) > > > > 2.) generating the spreadsheets for some reason MATLAB refuses to > > acknowledge my column headers when using xlswrite. I even followed a > > reccomended tutorial from MATLAB for how to set things up! > > > > This is what I have so far! > > > > > ... > > > ***PROBLEM 1. HERE*** > > x = strcat(input('Enter usernames for current cohort','s')); > > userNames = strsplit(x) > ... > > Play around w/ the following and see if any joy ensues... > > s=inputdlg('input: ','Input Box',3); > > If numlines>1 it appears will return a cell array of inputs from a > clipboard paste. If I open a Word doc and put, three text lines in it > and copy them I get > > >> s=inputdlg('input: ','Input Box',3) > s = > [3x5 char] > >> s{:} > ans = > Name1 > Name2 > Name3 > >> > > If numlines==1 then it pastes them all on the one line. > > doc inputdlg > > ... > > > *** PROBLEM 2 HERE*** > > %Stores Variable Data in a Matrix > > colHeader = {'Number Full Completion','Number Partial Completion Less > > than Five','Number Partial Completion Less than Ten','Number Partial > > Completion More than Ten','Number No Login'}; > > stats(1) = (totalCompleted); > > stats(2) = (partialUnderFive); > > stats(3) = (partialUnderTen); > > stats(4) = (partialOverTen); > > > > %% Saves Data into an xls spreadsheet > > saveName = ['Module_Status_Report' date] > > xlswrite(saveName,log,1) > > xlswrite(saveName,stats,2,'A2') > > xlswrite(saveName,colHeader,2,'A1') > > end > > I've never used xlswrite() so no help there, really, sorry... > > I note the following on the "Data to write" expansion... > > > to write, specified as a twodimensional numeric or character > > array, or, if each cell contains a single element, a cell array. > > > > If A is a cell array containing something other than a scalar numeric > > or a string, then xlswrite silently leaves the corresponding cell in > > the spreadsheet empty. > > Don't know if that's related to your problems/troubles/symptoms or not, > but is suggestive methinks... > > 
Thank you so much  I'll give these suggestions a try!
About the xlswrite it just seems crazy to me that it fills in the username information which is a string on sheet 1, but it wont fill strings in on sheet 2.
BTW  I feel like you've answered a billion of my questions on here, and I just wanted to say a sincere thank you. You have really made my journey of understanding MATLAB enjoyable :)



