Difference between clear var and clear var*
이전 댓글 표시
Hi all,
This will probably be a very straightforward question but I can't get to the bottom of it. I just started reading Mike Cohen's book 'MATLAB for Brain and Cognitive Scientists' this afternoon. He suggests checking the difference between 'clear a' and clear a*' in one of the preliminary chapters. They don't appear to do anything different. I have read the MATLAB documentation for 'clear' again (not to much to chew on), and I can't see anything.
Given what little I know about pointers from C++, I initially imagined that clear a* would remove the value stored in a from the workspace, but that the memory allocated to it would remain (just empty); and that clear a would remove variable a from the workspace entirely. I then checked both with 'whos' and both commands simply remove the variable and its value.
I downloaded a set of tip scripts from Mike's website for the book. The tip for that part of the chapter is simply:
%% 6
clear a
clear a*
In a last-ditch effort, I Googled it in a few different ways, but turned up nothing.
There are a thousand more interesting issues and questions I could ask, but this is just driving me up the wall because I can't find the answer, even though I know it will be simple. Does anybody know what exactly he is trying to get at with this?
Cheers!
Rowan.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Language Support에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!