Blkproc and inline function

Ben Abbott bpabbott at mac.com
Sun Mar 23 16:12:53 CDT 2008


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



More information about the Help-octave mailing list