clear, clear all and tic toc time

21 次查看(过去 30 天)
Hello everyone, What is the difference between ''clear;'' and ''clear all;'' when starting an algorithm? As i see, ''clear all;'' takes much time and erases everything in workspace.
  2 个评论
per isakson
per isakson 2012-8-2
Did you read the documentation on CLEAR?
Daniel Shub
Daniel Shub 2012-8-2
The need for either means you are not using functions and hence not doing it right.

请先登录,再进行评论。

采纳的回答

venkat vasu
venkat vasu 2012-8-2
clear Clear variables and functions from memory.
clear removes all variables from the workspace.
clear VARIABLES does the same thing.
clear GLOBAL removes all global variables.
clear FUNCTIONS removes all compiled MATLAB and MEX-functions.
clear ALL removes all variables, globals, functions and MEX links.
clear ALL at the command prompt also clears the base import list.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by