tags:

views:

214

answers:

1

I recently learned the ezplot function in MATLAB. Recently I typed in

ezplot('x^y - y^x', [-100 100 -100 100]);

and this is what I got;

alt text

Can anyone please tell me whatever is happening ? for lower scaling of x and y ( [ -10 10 -10 10]) there are more patterns in the 2nd 3rd and 4th quadrants.

I was not very sure of the shape of curve, but I did not expect this !

+2  A: 

I think that all bets are off when you ask Matlab to plot a function of 2 variables in only 2 dimensions. Especially so when some of the values occurring in your function are 1/0.

What is happening is that you are exposing the limitations of general purpose graph drawing tools to deal with functions for which they are not designed, and reminding yourself that you need some understanding yourself of what the computer is doing to be sure that the output you get is meaningful.

What shape did you expect the graph to be ?

High Performance Mark
@High Performance Mark : well .... 2 variables mean 2 dimensions (doesn't it ? :( ) .... 1/0 form will probably never occur in this curve ....but 0^inf and inf^0 may occur, however that still doesn't justify the type of 'tiling effect' that I am getting.I was expecting something like exp(x) type behaviour, which it does in the first quadrant.
Arkapravo
@Highperformance Mark : even x^y behaves oddly in 2nd quadrant
Arkapravo
@Arkapravo: 2 variables means 2 dimensions, but how would you display the result of the function? You'd need a third dimension for that.
Joachim Sauer
@Arkapravo: 1/0 occurs repeatedly in your function: x^-y is the same as 1/x^y (for real y) so whenever x (or y) is 0 the expression 1/0 is encountered. If I were you I'd tabulate some values of this function, figure out why @Joachim and I are telling you you need 3 dimensions to plot a function of 2 variables, and reform your expectations of what the plot of the graph might be.
High Performance Mark
@Joachim and @Mark: The equation plotted by EZPLOT will be `x^y - y^x = 0` in this case (the ` = 0` is implicit), so only 2 dimensions are needed. The problem is simply that complex values can result and only the real part is plotted, leading to strange looking graphs.
gnovice
@gnovice : Thanks
Arkapravo
@High Performance Mark : If this 2 variable curve is indeed 3 dimensions then are we dealing with fractals ? (Now, that is a completely different domain)
Arkapravo

related questions