help-octave
[Top][All Lists]
Advanced

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

Indexing functions?


From: denizyazgac
Subject: Indexing functions?
Date: Mon, 9 Oct 2017 04:26:27 -0700 (MST)

Hi;
I have a function  depends on X and Y. I know X, thats an array so my
function only depends on X
But I want to create an "array of functions" which behave like

f(1)= Y*1^2
f(2)=Y*2^2
f(3)=Y*3^2
.
.
.
I should create different fuctions because every function will be
postprossesed different way in further.


clear
clc
x=1:1:10;
for index=1:1:length(x);
  f(index)=@(y) y*x(index).^2;
end

Is there a way to do this?



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

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