Path: news.mathworks.com!not-for-mail
From: "Michael Hui" <myhui@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: FPT : how to inherit an fi object's attributes
Date: Sun, 17 Aug 2008 16:20:17 +0000 (UTC)
Organization: Broadcom Corp
Lines: 27
Message-ID: <g89j40$2ak$1@fred.mathworks.com>
References: <g84mjd$hpd$1@fred.mathworks.com> <g88da7$g56$1@fred.mathworks.com>
Reply-To: "Michael Hui" <myhui@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1218990017 2388 172.30.248.38 (17 Aug 2008 16:20:17 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 17 Aug 2008 16:20:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1388863
Xref: news.mathworks.com comp.soft-sys.matlab:485903



I thank you both for sharing your thoughts.

The difference between the following:

aq = fi(zeros(size(atan_quantized)),...
atan_quantized.fimath,...
atan_quantized.numerictype,...
'WordLength',atan_quantized.numerictype.WordLength+2,...
'FractionLength',atan_quantized.numerictype.FractionLength+2);

aq = fi(zeros(size(atan_quantized)),...
        atan_quantized.Signed,...
        atan_quantized.WordLength+2,...
        atan_quantized.FractionLength+2,...
        atan_quantized.fimath);

is that the first one takes in all properties of numerictype
without listing them out, and the second one lists them
explicitly.

I suppose the two will work differently if one adds more
properties to numerictype. The first method will continue to
inherit all properties and the second one might miss the new
properties.

So that's why both of you said the first method is the
proper method. Thanks for that!