Sibbs Gambling
Sibbs Gambling

Reputation: 20355

Recover history MATLAB code?

I have a script named my_script.m, which has been mistakenly replaced by another file with the same name. However, prior to overwriting the script, I have run it in MATLAB console. Hence, I have the following history.

>> my_script
>> 

Is there any way to recover that history file?


The reason why I think it is still possible is that I do have the run history of that script in my current console. If only I had selected all the script and run it! That way I would have every command in the console history. But now, it is simply one line as above.

Upvotes: 0

Views: 5951

Answers (3)

NKN
NKN

Reputation: 6424

Check if you had diary mode on, then everything is there:

get(0,'Diary')

Upvotes: 1

Daniel
Daniel

Reputation: 36710

Sometimes matlab writes backups, the file would be named my_script.asv. Check if it exists, it's located in the same directory.

Upvotes: 1

user1345112
user1345112

Reputation: 342

You can open the file in windows explorer, right mouse button, properties. Then check if there are any other versions of the file in the Previous Versions tab ;)

Upvotes: 1

Related Questions