home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ulowell!m2c!nic.umass.edu!noc.near.net!MathWorks.Com!nuntius
- From: little@mathworks.com (John Little)
- Newsgroups: comp.soft-sys.matlab
- Subject: Re: Parser bugs
- Message-ID: <C1HIAv.6EE@MathWorks.COM>
- Date: 26 Jan 93 23:23:18 GMT
- References: <1993Jan22.215229.14108@MathWorks.COM>
- Sender: news@MathWorks.COM (Usenet News Account)
- Organization: The MathWorks, Inc.
- Lines: 49
- X-Useragent: Nuntius v1.1
-
- In article <1993Jan18.155531.4025@tdb.uu.se> Peter Haegglund,
- peterh@tdb.uu.se writes:
- >: Hi,
- >: Just curious whether a couple of parser bugs/quirks have been fixed
- >: in version 4.0. Two such quirks that come to mind are:
- >:
- >: 1)
- >: >> 4 * -1 % this will result in an error
- >: >> 4 * (-1) % this will work
- >:
- >: 2)
- >: >> [1 + 2 * 3, 4] % how many elements in this matrix?
- >:
- >: This handling of unary operators is just a little unintuitive --
- usually
- >: mere nuisance value.
-
- The first of these "quirks" is a reasonable suggestion and I'll see that
- it is added to our "wish list" for possible inclusion into a future
- version of MATLAB.
-
- The second of these two "quirks" has been "improved". As several other
- people point out, spaces are significant inside brackets. This is
- a "nice" feature in that it allows statements like
-
- a = [a b; c d]
- a = [1 2 3 4 5 6]
-
- rather than requiring commas between matrix elements. However using
- MATLAB 3.5 the statement
-
- a = [1 + 2 * 3, 4]
-
- gives you
-
- a = 1 6 4
-
- because the "+" is treated as the sign on the 2. Using MATLAB 4.0 this
- now returns an answer that is more likely to be what you intended:
-
-
- a = 7 4
-
- We noticed too that if there are spaces around the operator then it
- is unambiguous what you want.
-
-
- John Little
- little@mathworks.com
-