Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!news.glorb.com!news2.glorb.com!postnews.google.com!u36g2000prn.googlegroups.com!not-for-mail
From: TideMan <mulgor@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to make rows and columns from excel files? please help
Date: Wed, 4 Nov 2009 14:40:45 -0800 (PST)
Organization: http://groups.google.com
Lines: 60
Message-ID: <33030a85-c19f-40c3-9bed-b4d7863d07c6@u36g2000prn.googlegroups.com>
References: <hcqkgq$n9$1@fred.mathworks.com> <09f4f3a9-b4b9-47ea-b907-c00fb7e9d1fe@m3g2000pri.googlegroups.com> 
	<c5f5c5f5-082a-445e-8cb0-ea3cfdfe314e@g1g2000pra.googlegroups.com> 
	<hcsu5m$pdn$1@fred.mathworks.com>
NNTP-Posting-Host: 202.78.152.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1257374445 28331 127.0.0.1 (4 Nov 2009 22:40:45 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 4 Nov 2009 22:40:45 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: u36g2000prn.googlegroups.com; posting-host=202.78.152.105; 
	posting-account=qPexFwkAAABOl8VUndE6Jm-9Z5z_fSpR
User-Agent: G2/1.0
X-HTTP-Via: 1.1 bc7
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) 
	Gecko/20091016 Firefox/3.5.4,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:582549


On Nov 5, 11:11 am, "rohan patel" <rpatel...@live.com> wrote:
> TideMan <mul...@gmail.com> wrote in message <c5f5c5f5-082a-445e-8cb0-ea3cfdfe3...@g1g2000pra.googlegroups.com>...
> > On Nov 5, 8:58?am, "rohan patel" <rpatel...@live.com> wrote:
> > > TideMan <mul...@gmail.com> wrote in message <36c3a68d-10d9-4573-bf0c-6a60ef50e...@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.
>
> > Why would you want to do this without using the sum function?
> > Is this homework?
>
> Yes, my teacher is being mean =[ and im stressing out so much. please help me

I've helped you enough already.
You can work out how to add up numbers yourself.
One way that doesn't use sum is:
mean(numbers(igame,:)))*length(numbers(igame,:));
but your teacher may think you're being a smartass.