필터 지우기
필터 지우기

Working backwards from a command window

조회 수: 1 (최근 30일)
Alex
Alex 2013년 4월 15일
Hey all, I had a strange question that I couldn't find an answer for, perhaps I could get some help here?
A friend of mine was working on an m file for an assignment, and had been executing it to see the results. After deleting the trash on her user account, the m file vanished from the harddrive, but all the outputs from the execution of said m file remained in the command window, which brings me to the question:
Is it possible to use Matlab to work backward from the results in the command window to recover the commands from the m file? Since Matlab was dependent on those commands to generate the output I mean. I also am not looking for an intuitive 'you can see the output, so you can manually discern the m file's contents' type solution.
I hope that makes sense?
--Alex--

채택된 답변

Jan
Jan 2013년 4월 15일
편집: Jan 2013년 4월 15일
No, this will not work in general.
An exception would be, if a echo on all enabled the display of all processed code during the program runs. But without this there is no chance to use the output to the command window to decide, which code has created this output. Example:
% Command window:
2
% Possible codes:
x = [pi, sin(1.234)];
fprintf('%d\n', length(x))
% Or:
x = clock;
fprintf('%d\n', x(5))
And this is a very trivial example only.
But it would be trivial to reconstruct the deleted file in the leven of the operating system. Deleting does not overwrite the biots on the harddisk, but removes the point in the file system table only.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Performance and Memory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by