Can I import history.m from 2013 to History.xml in 2014a?

조회 수: 2 (최근 30일)
Matlab Challenged
Matlab Challenged 2014년 5월 16일
댓글: Martin Siler 2015년 3월 6일
Why OH why does Mathworks changes things that worked great in one version - I hate their new releases and the changes that simply frustrates how one is used to doing things.
For several releases now, I always copied my previous release's "history.m" file into the appropriate directory and I could go on with what I had done. Come 2014a, they decided to make the history into an XML file and I am now grinding my teeth in frustration, because I cannot simply use the up arrow and go with what I was doing before I updated to the new release. I have to keep the old history file open and copy and paste from there. I had my history set to 50,000, so I remembered some years of commands. Very helpful when I want to remember the set of commands I used on a specific day in the past.
Mathworks - your ribbon interface was a bad idea, now this history is a bad idea. Maybe it is time to abandon Matlab and find an alternate....
  댓글 수: 1
Student OfWorld
Student OfWorld 2014년 5월 23일
I agree! this is extremely frustrating.
Has someone come up with a way/script to parse old history.m files into this novel History.xml format? I must have approx. 2 years worth of commands that I'd very much like to access by hitting the top arrow button...

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

답변 (2개)

Peter Muellers
Peter Muellers 2014년 5월 27일
When upgrading from the immediate preceding release, in this case from R2013b to R2014a, the previous history should be brought along automatically. If you have skipped a release you can do the following:
  1. Exit MATLAB if it is running
  2. Delete history.xml and history.bak if they exist from the R2014a preferences folder
  3. Copy history.m from a previous release preferences folder into the R2014a prefercences folder
  4. Restart MATLAB. It should do a one-time read from history.m. Going forward the history will be saved to and read from history.xml
  댓글 수: 5
Thomas Lobay
Thomas Lobay 2015년 2월 6일
This does not work for me. I am going from R2012b to R2014b on a Ubuntu 14.04 64 bit. Is there a fix for linux users without resorting to a third party converter.
Martin Siler
Martin Siler 2015년 3월 6일
The same for me. You need to take your history.m rename it to History.xml but keep orignal History.xml opened elsewhere.
  1. Replace all occurences of < and > by html entities & lt; and & gt; (remove space between & and the rest, it was automaticalicaly visualized by html viewer here into < >)
  2. Then replace all lines by <command> line content </command>. I used kate and regular expression in replacement as ^(.*)$ and replaced it by <command>\1<\command>
  3. Then add header and footer form original History.xml
<?xml version="1.0" encoding="utf-8"?>
<history>
<session>
and footer
</session>
</history>
Probably all can automated using sed and awk
Good Luck

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


Jan-Gerrit
Jan-Gerrit 2014년 9월 8일
Is there a way to call the internal java function to do the conversion? I have multiple history.m files and don't really want to restart matlab every time i want to use one of them..
Loading the file with com.mathworks.mde.cmdhist.AltHistory.load(someFile, false); does not work.
Thanks Jan

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by