Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Size-function and ";"
Date: Tue, 27 Oct 2009 13:12:32 -0500
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <hc7dg7$p35$1@news.eternal-september.org>
References: <hc6rc3$4ji$1@fred.mathworks.com> <hc6scn$cmv$1@news.eternal-september.org> <hc7bdr$mtg$1@fred.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.eternal-september.org U2FsdGVkX19llHIq9rcQ8e2q36UjOf9sltKHKPK9kZV0G8aTcmh/EHeSg3eM3TdercDKLa+wzyVz7WdhA0/hhRVgHUiZycpnCopmXwxQ19CsnCbyXXw74y0XHEyjrOksGGG8yWGG4uca2iXsY1S8gQ==
X-Complaints-To: abuse@eternal-september.org
NNTP-Posting-Date: Tue, 27 Oct 2009 18:17:44 +0000 (UTC)
In-Reply-To: <hc7bdr$mtg$1@fred.mathworks.com>
X-Auth-Sender: U2FsdGVkX19R11yd5OIHPzzRLXrB5C15KOw1RSQKOGk=
Cancel-Lock: sha1:GupkuFoDMyNHf9Q0kY8YN5kBaiM=
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
Xref: news.mathworks.com comp.soft-sys.matlab:580422


Adam Andersen L?ss?e wrote:
> Okay, here is the entire code up until the problem:

...[code elided for brevity]...

> If ";" is omitted from 4th line from the bottom size(sys.T,2) works
> as expected, and returns 8.
> If ";" is included size(sys.T,2)  returns only 4. This corresponds to
> the last loop being omitted. When, however I type size(sys.T,2) in
> the command window after the code has been executed, it returns the
> proper result, 8.

I pasted your code into a file tryit.m and ran it w/ and w/o the subject ";"

 >> tryit
sys =
     X: [27x2 double]
     T: {[1 3 19]  [3 5 21]  [5 7 23]  [7 9 25]  [3 21 19]}
sys =
     X: [27x2 double]
     T: {[1 3 19]  [3 5 21]  [5 7 23]  [7 9 25]  [3 21 19]  [5 23 21]}
sys =
     X: [27x2 double]
     T: {[1 3 19]  [3 5 21]  [5 7 23]  [7 9 25]  [3 21 19]  [5 23 21] 
[7 25 23]}
sys =
     X: [27x2 double]
     T: {1x8 cell}
ans =
      8
 >> tryit
ans =
      8
 >> sys
sys =
     X: [27x2 double]
     T: {1x8 cell}
 >>

No discernible difference here...

(R12, rather old; perhaps somebody w/ newer version can check as well)

--