Tab Key Not Working

32 ビュー (過去 30 日間)
Tobias
Tobias 2022 年 9 月 8 日
回答済み: Kartik 2023 年 2 月 23 日
Hi, I've recently installed Matlab, and I am following an introductory booklet to help me get to grips with the code. One thing that I am having a problem with is indenting code. When I press the tab button on my keyboard, nothing happens. I have checked in preferences to see that the tab button is mapped to "tab", so it should tab 8 spaces (as I can see is the default amount) but rather, nothing happens. The same is the case when I highlight code and tab after typing it, which, from what I have read, should indent it also. I am using Matlab_R2022a on an Apple MacBook, with macOS Monterey installed. Anybody got any ideas as to why my tab key isn't working? It works in all other applications, and indents as expected, on microsoft word, for example, so is not a physical issue with the key.
  2 件のコメント
chrisw23
chrisw23 2022 年 9 月 8 日
try to set a space before tabbing
Tobias
Tobias 2022 年 9 月 8 日
@chrisw23 as in hitting space and then tab? This doesn't do anything (apart from inserting a space).

サインインしてコメントする。

回答 (1 件)

Kartik
Kartik 2023 年 2 月 23 日
Hi,
It sounds like your issue might be related to the settings in your MATLAB Editor Preferences. Here are some things you can try to get your Tab key working properly:
  1. Check your Editor Preferences: Go to Preferences > Editor/Debugger > Editor > Language, and make sure that the "Indent with tabs" checkbox is selected.
  2. Try changing the Tab key behaviour: In the Editor Preferences, go to the "Key bindings" tab, and look for the "Tab" key. Try changing the behaviour to "Indent selection" or "Insert tab character" and see if that works.
  3. Check for conflicting keyboard shortcuts: It's possible that another application or system setting is overriding the Tab key in MATLAB. Go to System Preferences > Keyboard > Shortcuts and look for any conflicting keybindings that might be interfering with the Tab key in MATLAB.
  4. Try resetting MATLAB preferences: If none of the above steps work, try resetting MATLAB preferences to their default settings. To do this, go to Preferences > General > Reset Preferences and follow the prompts.
For more information, you can refer to the following MathWorks documentation:

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by