Skip to main content
8-Gravel
January 14, 2018
Solved

Defining a function vector inside a programm

  • January 14, 2018
  • 2 replies
  • 4195 views

Hi people, It is very strange to me. I can not define a function vector inside a program. Take a look at the problem.

Thank you

 

 

Jesus

Best answer by ValeryOchkov

May be so?

y2.png

2 replies

23-Emerald IV
January 14, 2018

Try to define it the same way you defined the first g(x), so with an immediate array, instead of assigning expressions to the first and second elements of the array.

Your definition of A3(a) fails because x is an unknown. This may work if you include a symbolic evaluation at the definition.

(I can't try it out, because I'm limited to Prime express.)

 

Success!
Luc

24-Ruby IV
January 14, 2018

May be so?

y2.png

hegel8-GravelAuthor
8-Gravel
January 16, 2018

Thank you Valery, Luc and Werner.  Here a  synapsis.

25-Diamond I
January 14, 2018

The way you try to define your function in A2 would not work outside a program on worksheet level either.

You have to define your function the very same way as you defined g(x) on the very top of your sheet (as Luc and Valery already wrote/showed).

Another way which works also with numerical evaluation is shown below

Bild.png

Of course in this approach g is not a local function but a simple vector variable. So you can't use it as a function inside your program. Your sheet does not show if you intend to do this, though.

If this is your goal and you insist on defining the functions singly, you could use something like this:

Bild2.png