フィルターのクリア

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 Center および File ExchangePerformance and Memory についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by