MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > Converting Matrix Dimensions? 

I have a problem in my class and the data is given in a 20x4 data file. It asks to find the mean, median and other things. However we're not allowed to use the mean function to find the mean. I have an idea that by converting the matrix into a 1x80 and then adding the sum and dividing by 80, I'll get the answer. But how do you convert the matrix from 20x4 to 1x80? Thanks 
"Jens Doe" <jerald29@hotmail.com> wrote in message <gktk1p$7ak$1@fred.mathworks.com>... 
"Jens Doe" <jerald29@hotmail.com> wrote in message <gktk1p$7ak$1@fred.mathworks.com>... 
Thank you for your help so far. However, I can not get either of these two codes to work. I'll post my code for both 
"Jens Doe" <jerald29@hotmail.com> wrote in message <gl0hap$83m$1@fred.mathworks.com>... 
There is a problem here. What you are assigning to the variable 'numbers' is not the data stored in the file, but the name of the file. 
"Matt Fig" <spamanon@yahoo.com> wrote in message <gl0ii5$ru9$1@fred.mathworks.com>... 
I assume you are using Matfiles which store Matlab variables. If so then this should work. 
"Matt Fig" <spamanon@yahoo.com> wrote in message <gl0lc7$3ta$1@fred.mathworks.com>... 
"Jens " <jerald29@hotmail.com> wrote in message 
Subject: Converting Matrix Dimensions? From: Steven Lord Date: 19 Jan, 2009 15:40:40 Message: 11 of 12 

Good point Steve. While the code is a bit more 'clunky' it does avoid confusion over loaded variables and those that were in the workspace prior to running this function. 
No tags are associated with this thread.
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.