# HELP

2 messages
Open this post in threaded view
|

## HELP

 Hello there,   I need help with an simple Octave Code, which shows me this error:   >> a=numgrad(y,2) error: 'x' undefined near line 27 column 5 error: called from     y at line 27 column 4     for the following function:   function a = numgrad (fname,x)   h=10^(-8);   n=length(x);   for i=1:n     a(i)=(feval(fname,x+h*einheitsvektor(n,i))-feval(fname,x-h*einheitsvektor(n,i)))/(2*h);     end     Thank you!
Open this post in threaded view
|

## Re: HELP

 On Fri, May 18, 2018 at 9:57 AM, Kordasch, Michaela wrote: Hello there,   I need help with an simple Octave Code, which shows me this error:   >> a=numgrad(y,2) error: 'x' undefined near line 27 column 5 error: called from     y at line 27 column 4  you must have a function maned  yDid you make a file called y.m?    for the following function:   function a = numgrad (fname,x)   h=10^(-8);   n=length(x);   for i=1:n     a(i)=(feval(fname,x+h*einheitsvektor(n,i))-feval(fname,x-h*einheitsvektor(n,i)))/(2*h);     end     Thank you! -- DAS