Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How to use Compile[]?' topicStudent Support Forum > General > "How to use Compile[]?"

Help | Reply To Topic
Author Comment/Response
Caitienn
04/05/03 11:30pm

yeah,I have noticed the Compile function, but I do not think it can enhance the programming effects,esp.when rendering density plot.
Example:
fig=DensityPlot[Nest[Cos@#Tan@#&,Sin@(Sin@x^2Cos@y^2)^1/2,10],
{x,-2Pi,2Pi},{y,-2Pi,2Pi},
ColorFunction->Hue,
Frame->True,
FrameStyle->Hue[.24],
PlotPoints->300,
Mesh->False,AspectRatio->Automatic];
I'd use Compile to enhance the program efficiency above as follows:
grap=Compile[{},Module[{},DensityPlot[Nest[Cos@#Tan@#&,Sin@(Sin@x^2Cos@y^2)^1/2,10],
{x,-2Pi,2Pi},{y,-2Pi,2Pi},
ColorFunction->Hue,
Frame->True,
FrameStyle->Hue[.24],
PlotPoints->300,
Mesh->False,AspectRatio->Automatic]]];
graph;
Then,I think there should not be some bugs in the above program.I just want to use Compile[]to enhance programming efficiency.
Thank you for replying.


URL: ,
Help | Reply To Topic