Blkproc and inline function

mod at autograf.pl mod at autograf.pl
Mon Mar 24 04:17:24 CDT 2008


Ben Abbott pisze:
>
> On Mar 23, 2008, at 2:18 PM, mod at autograf.pl wrote:
>> Hi,
>> It's my first fight with Octave (after SciLab) and I've some trouble
>> with using blkproc function.
>> When I pass function inline, like this blkproc(image, [16 16],
>> 'P1*x*P2', T, T') I've got error like this:
>> "error: feval: the symbol `P1*x*P2' is not valid as a function".
>>
>> T, T' - arrays (P1, P2 parameters just like in Matlab).
>>
>> Is there any  trick to pass  this (P1*x*P2) function to blkproc without
>> error?
>> Thx.
>>
>> -- 
>> Pawel
>
> P1*x*P2 is not a function.
>
> I haven't used image(), but if I infer correclty, you'll need to first 
> create your function
>
> function y = yourfunction (x, P1, P2)
>   y = P1*x*P2;
> endfunction
>
> It should be saved as yourfunction.m
>
> Then call
>
> blkproc(imag, [16, 16], @yourfunction, T, T')
>
> I may not have everything exactly correct, but @yourfunction is a 
> handle to "yourfuntion".
>
> Ben
>
This is what I need (I've "yourfunction" in the same script). It works. 

Thank U Ben.

-- 
Pawel <mailto:mod at autograf.pl>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080324/a122a521/attachment.html 


More information about the Help-octave mailing list