Path: news.mathworks.com!not-for-mail
From: "rohan patel" <rpatel133@live.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to make rows and columns from excel files? please help
Date: Wed, 4 Nov 2009 19:58:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 34
Message-ID: <hcsmca$h0u$1@fred.mathworks.com>
References: <hcqkgq$n9$1@fred.mathworks.com> <09f4f3a9-b4b9-47ea-b907-c00fb7e9d1fe@m3g2000pri.googlegroups.com> <36c3a68d-10d9-4573-bf0c-6a60ef50eaa6@g23g2000yqh.googlegroups.com>
Reply-To: "rohan patel" <rpatel133@live.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257364682 17438 172.30.248.38 (4 Nov 2009 19:58:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Nov 2009 19:58:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2075713
Xref: news.mathworks.com comp.soft-sys.matlab:582507


TideMan <mulgor@gmail.com> wrote in message <36c3a68d-10d9-4573-bf0c-6a60ef50eaa6@g23g2000yqh.googlegroups.com>...
> On Nov 4, 5:27?pm, "rohan patel" <rpatel...@live.com> wrote:
> > TideMan <mul...@gmail.com> wrote in message <09f4f3a9-b4b9-47ea-b907-c00fb7e9d...@m3g2000pri.googlegroups.com>...
> > > On Nov 4, 2:14?pm, "rohan patel" <rpatel...@live.com> wrote:
> > > > 'Game' ? ? ? ? 'January' ? ?'February' ? ?'March' ? ?'April' ? ?'May' ? ? ?'June'
> > > > ?'iKitty' ? ? ? ? ? ?75] ? ? ? ? 254 ? ? ? ? ? 1235 ? ? 1820 ? ? ?2114 ? ? 1600
> > > > 'ShootEmUp' ? 3584] ? ? 4588 ? ? ? ? ?9421 ? ? 10588 ? ?12788 ? ?16889
> >
> > > > okay i have this. i know how to put in rows and columns for iKitty and ShootemUP.
> >
> > > > [numbers, text, everything] = xlsread(fileName);
> >
> > > > iKitty = numbers(1,:);
> > > > shootEmUp = numbers(2,:);
> >
> > > > but i need to figure out how if there was more data add(such as new game) how can i use a for loop to put everything in row and columns?
> >
> > > One solution is to use a structure:
> > > [ngames,nmonths]=size(numbers);
> > > for igame=1:ngames
> > > ? ?Game.(text{igame+1,1})=numbers(igame,:);
> > > end
> >
> > okay i done this but if i add another game application to the data sheet will it create rows and columns for that also?
> > and
> > i have another problem i want to find the total number of quantity sold in for each game so how would i for loop it to add to get results?
> 
> Yes, my method will expand as you add extra rows.
> Please do not listen to posters who suggest that you use the eval
> function.
> It is an evil function that will lead to you to unhappiness.


Tideman, okay i got this. but now my problem is i need to add the rows to get the total quantity for that game. how can i do this without using the sum fuction.