Prev: Radial Basis Function
Next: normalize retina image.
From: XYZ on 14 Mar 2010 11:26 Hi, Matlab underlines the following line as being incorrect for obj.prop1=1:28 ^ <- error here func1(obj) end prop1, func1 are class property/method. The only solution that comes to my mind is to subsitute obj.prop1 with local variable (e.g. k) and pass it to func1(obj, k). But this isn't as nice as my original code. Is there any other method to use class property as loop variable? Thanks!
From: Doug Schwarz on 14 Mar 2010 11:35 In article <hniv7b$dfd$1(a)news.onet.pl>, XYZ <junk(a)mail.bin> wrote: > Hi, > > Matlab underlines the following line as being incorrect > > for obj.prop1=1:28 > ^ <- error here > func1(obj) > end > > prop1, func1 are class property/method. The only solution that comes to > my mind is to subsitute obj.prop1 with local variable (e.g. k) and pass > it to func1(obj, k). But this isn't as nice as my original code. > Is there any other method to use class property as loop variable? > > Thanks! How about this? for k = 1:28 obj.prop1 = k; func1(obj) end -- Doug Schwarz dmschwarz&ieee,org Make obvious changes to get real email address.
From: XYZ on 14 Mar 2010 11:43 On 14.03.2010 16:35, Doug Schwarz wrote: > In article<hniv7b$dfd$1(a)news.onet.pl>, XYZ<junk(a)mail.bin> wrote: > >> Hi, >> >> Matlab underlines the following line as being incorrect >> >> for obj.prop1=1:28 >> ^<- error here >> func1(obj) >> end >> >> prop1, func1 are class property/method. The only solution that comes to >> my mind is to subsitute obj.prop1 with local variable (e.g. k) and pass >> it to func1(obj, k). But this isn't as nice as my original code. >> Is there any other method to use class property as loop variable? >> >> Thanks! > > How about this? > > for k = 1:28 > obj.prop1 = k; > func1(obj) > end > Well, that's exactly what I need. I wonder why I didn't think about this earlier. Thanks Doug!
|
Pages: 1 Prev: Radial Basis Function Next: normalize retina image. |