0
|
3872 Views
|
5 Replies
|
2 Total Likes
View groups...
Share
GROUPS:

# Mathematica syntax errors

Posted 11 years ago
 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!?
5 Replies
Sort By:
Posted 11 years ago
 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 arguments2 - some functions require arguments3 - 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 Side5 - the multiplication sign can be replaced with a space between two operands6 - Plot3D plots a function as a function of two variables
Posted 11 years ago
 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}]
Posted 11 years ago
 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`*"]
Posted 11 years ago
 Sorry.  Formatting glich (being worked on).  If you put square brackets in regular text, they can disappear. To make sure thay appear in code, highlight the code and click the little spikey in the formatting tools above the text input area. This formats the selected text as Mathematica code.
Posted 11 years ago