? Undefined function or variable 'x'.

  • Thread starter Thread starter tictaclp
  • Start date Start date
  • Tags Tags
    Function Variable
AI Thread Summary
The discussion centers around an error encountered in a MATLAB function, specifically the "Undefined function or variable 'x'" message. The function, intended to compute a mathematical expression and its first derivative, fails due to the variable 'x' not being defined within its scope. The user seeks assistance in resolving this issue. The code provided shows the function definition, but the lack of a defined variable 'x' is highlighted as the primary cause of the error. The conversation emphasizes the importance of ensuring all variables are properly defined before use in MATLAB functions to avoid such errors.
tictaclp
Messages
3
Reaction score
0
? Undefined function or variable 'x'.

function [ f, f1] = funyder( z )
%funcion y primera derivada del primer ejercicio
f=1-1/(1-x+2*z^2)
f1=(4*z-1)/(1-z+2*z^2)^2

this doesn't work .
Thanks
 
Physics news on Phys.org


tictaclp said:
function [ f, f1] = funyder( z )
%funcion y primera derivada del primer ejercicio
f=1-1/(1-x+2*z^2)
f1=(4*z-1)/(1-z+2*z^2)^2

this doesn't work .
Thanks

Welcome to PhysicsForums. Note the bolded bits above!
 

Similar threads

Replies
4
Views
1K
Replies
3
Views
2K
Replies
4
Views
4K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
5
Views
3K
Replies
3
Views
2K
Replies
1
Views
2K
Back
Top