Identify and correct the syntax errors in the following expression and plot the function a(x,y)
Clear [a]
a[x,y] = ArcTan (x^2 - 2 xy + y^2) +Sin[Pixy]
Plot[a, {x,-1,1},{y, -1, 1}]
how do i correct and plot this!?
Identify and correct the syntax errors in the following expression and plot the function a(x,y)
Clear [a]
a[x,y] = ArcTan (x^2 - 2 xy + y^2) +Sin[Pixy]
Plot[a, {x,-1,1},{y, -1, 1}]
how do i correct and plot this!?
Presumably you want some hints, rather than the answer (learning is not as effective otherwise)? So:
1 - functions require square brackets, even if there are no arguments
2 - some functions require arguments
3 - Plot plots a function as a function of a single variable (not two)
4 - variables supplied as arguments to a ‘function’ are bound using patterns with underscore characters on the Left Hand Side
5 - the multiplication sign can be replaced with a space between two operands
6 - Plot3D plots a function as a function of two variables
thank you so much,
does this look better?
Clear[a];
a[x_, y_] = ArcTan [x^2 - 2 x y + y^2] + Sin[Pi x y];
Plot3D[a[x, y], {x, -1, 1}, {y, -1, 1}]
Clear;
does nothing. If you want to clear the value of a specific symbol, use
Clear[a];
If you want to clear all values of all user-created symbols, use
Clear["Global`*"]