Q:為何Mathematica7.0以下程式無法輸出
For[n=1,n<=50,n+=2,Plot[Sin[nx],{x,-6Pi,Pi},PlotRange->{-2,2}]]
Ans:Mathematica7.0預設函數加分號不輸出,此外在迴圈裡面的Plot函數預設以分號結尾。所以上述程式無法輸出。若要輸出的話,將程式加個Print
For[n=1,n<=50,n+=2,Print@Plot[Sin[n*x],{x,-6Pi,Pi},PlotRange->{-2,2}]]
Tags:
Mathematica 教學,
Mathematica 教學 畫圖,
Teaching
讀者回應 ( 0 意見 )
訂閱發佈留言 (Atom)
發佈留言
Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.
如果這篇文章對你有幫助,那請留個訊息給我~