Path: news.mathworks.com!not-for-mail
From: "us " <us@neurol.unizh.ch>
Newsgroups: comp.soft-sys.matlab
Subject: Re: strange problem
Date: Tue, 31 Jul 2007 15:09:54 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 18
Message-ID: <f8njc2$m2p$1@fred.mathworks.com>
References: <f8nior$82s$1@fred.mathworks.com> <f8niuq$ckb$1@fred.mathworks.com>
Reply-To: "us " <us@neurol.unizh.ch>
NNTP-Posting-Host: webapp-01-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185894594 22617 172.30.248.36 (31 Jul 2007 15:09:54 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 31 Jul 2007 15:09:54 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:421862


yunzhi cheng:
<SNIP function-is-var evergreen...

> x = ones(1,8);
> n = length(x)
> then MATLAB shows 
> n=  0.1515    0.1515    0.1515    0.1515    0.1515    0.1515    0.1515    0.1515...

most likely, you created a variable <length>...
hence, this should help

     clear length;
     x=ones(1,8);
     n=length(x)
% if NOT, show CSSM the output of this
     which length -all

us