Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Converting Matrix Dimensions?
Date: Mon, 19 Jan 2009 00:26:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 48
Message-ID: <gl0hap$83m$1@fred.mathworks.com>
References: <gktk1p$7ak$1@fred.mathworks.com> <gkvjgd$e4c$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1232324761 8310 172.30.248.37 (19 Jan 2009 00:26:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 19 Jan 2009 00:26:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1674909
Xref: news.mathworks.com comp.soft-sys.matlab:512361


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

using (:).'

numbers=input('What data file would you like to load? ','s')
    
    load(numbers)
    
    numbers(:).'
    
    allnumbers=numbers(:).'
    
    length(allnumbers)
    
    l=length(allnumbers)
    
    disp(['Length of data ' num2str(l)])
    
   sum(allnumbers)
   
   s=sum(allnumbers)
   
   mean=s/l
   
   disp(['Your mean is ' num2str(mean)])

Two things that are wrong with this. It says that the length of the data is 10 instead of 80 and it says the sum is 915 instead of 6477. 


Then using the reshape(A,[],1)

clear
clc

data=input('What file would you like to load? ','s')

load(data)

a=reshape(data,[],1)

disp(['Length of data ' num2str(a)])


With this I'm getting an error of 
??? Error using ==> horzcat
CAT arguments dimensions are not consistent.

I'm not too sure whats wrong with either.