Is it possible to overwrite any of these variables:pi, eps, inf, i ? If so, how can it be undone?

 채택된 답변

Matt Fig
Matt Fig 2012년 10월 12일
편집: Matt Fig 2012년 10월 12일
Those are not variables, but functions.
which pi
which eps
You can mask any function with another function or a local variable. Of course this is a bad habit and many questions on this very site have arisen because people say, "MATLAB is broken, the MAX function doesn't work!" Here's what they did:
max = 0:5;
max(max) % Oops, this will not find the largest element anymore!
To undo the mask, simply clear the variable. If you have made a function in the local directory with the same name as a MATLAB function, you will have to delete it to undo the masking.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Software Development Tools에 대해 자세히 알아보기

질문:

2012년 10월 12일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by