command line completion / search

조회 수: 6 (최근 30일)
Daniel
Daniel 2015년 1월 10일
댓글: Niraj Desai 2023년 9월 16일
In older releases of Matlab, when you started typing a line that matched the beginning of a line in your command history, pressing the up arrow would take you to that line. In 2014a, pressing the up arrow takes you to the last line that contains a matching string anywhere in the line, which I find much less helpful. How do I tell it that I want to match the beginning of the line?
  댓글 수: 2
Daniel
Daniel 2015년 1월 10일
I just discovered that this is only a problem on Macintosh, not Windows.
John D'Errico
John D'Errico 2015년 1월 10일
I just checked on my Mac, using R2014b. No such problem.

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

채택된 답변

Peter Muellers
Peter Muellers 2015년 1월 22일
In R2014a and subsequent releases the default behavior is "Match Beginning", just as it has always been. R2014a did introduce the "Match Anywhere" option but it was only selectable from the drop down in the upper-left corner of the command history window. R2014b exposed this option in the preferences. I think the only way you could have acquired the "Match Anywhere" behavior without explicitly selecting it would have been by running the R2014a pre-release, where MathWorks experimented with having "Match Anywhere" as the default.
  댓글 수: 2
K E
K E 2016년 5월 17일
편집: K E 2016년 5월 17일
To change this, go to Environment tab of command window: Preferences > Command History > Match Beginning. I was getting this problem on my PC, probably because I had absentmindedly changed a preference. R2015b.
Niraj Desai
Niraj Desai 2023년 9월 16일
Thank you. This explains how to change the matching behavior. This should be the accepted answer, not the one you responded to.

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

추가 답변 (1개)

John D'Errico
John D'Errico 2015년 1월 10일
편집: John D'Errico 2015년 1월 10일
I believe the reason I have no problem on my Mac is because of the preferences. In the preferences "Command History" tab, you can select "Match anywhere", or "Match beginning" via a choice of radio buttons. Logically, match beginning is what you wish to use. I tested it by changing that button, and I can get the behavior you saw.
So this is NOT a Mac specific issue, but a simple preference issue. Of course, it is vaguely possible that they changed this from R2014a to R2014b. In that case, time for an upgrade.
  댓글 수: 1
Daniel
Daniel 2015년 1월 12일
As it turns out, this is a version-specific issue. I've installed R2014b and (unlike R2014a) it has the buttons you described, in both the Mac and Windows versions.

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

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by