help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

anonymous function


From: Martijn
Subject: anonymous function
Date: Wed, 15 Jun 2011 23:00:27 +0200

Hi,
Is it possible to use a function with multiple outputs in a anonymous
function? E.g.

function [x, y] = f(t)
...
end

g = @(t) sum(f(t))

where sum adds x(t) and y(t). A function that creates an vector of all
output parameters: g = @(t) sum(vector_output(f(t), 2))

where 2 is the number of requested output variables.

At this moment I just use normal function, but I prefer an anonymous
function for purposes like leasqr calculations and integration.

Thanks,

Martijn





reply via email to

[Prev in Thread] Current Thread [Next in Thread]