필터 지우기
필터 지우기

How to save statitiscs displayed in workspace as text file?

조회 수: 1 (최근 30일)
Emerson De Souza
Emerson De Souza 2011년 4월 20일
Is there a way to save the statistics displayed on workspace
as a text file (as if I would record an image of workspace)?
IMPORTANT: I don't to save the workspace by the command
save ('FILENAME', 'VARIABLE', 'VARIABLE',...)
Thank you
Emerson
  댓글 수: 2
Paulo Silva
Paulo Silva 2011년 4월 20일
What do you mean by "statistics displayed in workspace"?
What classes are involved? class(variable)
Emerson De Souza
Emerson De Souza 2011년 4월 20일
Hi Paulo,
imagine I would print the screen and save an image of the work space. That's what I want to do by saving a LIST OF CONTENTS, but not the variables. This saved file (as text format, image, whatever...) would be used only for later review of the parameters.
Hope you know a way to do this
Thank you
Emerson

댓글을 달려면 로그인하십시오.

채택된 답변

Matt Tearle
Matt Tearle 2011년 4월 20일
Do you mean you want a list of variable names, sizes, classes, bytes used,...? If so, you could do vars = whos, then save/write the result.
EDIT TO ADD:
To write to a text file
fid = fopen('variable.log','wt');
vars = whos
for k=1:length(vars)
fprintf(fid,'%s %s %s %u\n',...
vars(k).name,mat2str(vars(k).size),vars(k).class,vars(k).bytes);
end
fclose(fid);
BUT, if the default output from whos is what you want, the simplest approach is probably:
diary('variable.log')
datestr(now)
whos
diary off
  댓글 수: 1
Emerson De Souza
Emerson De Souza 2011년 4월 20일
Hi Matt, whos makes exactly the list that I want in command window. Now, how do I save that?
Thank you
Emerson

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by