Character for "ENTER"

I want to break a loop by pressing ENTER key. What character does ENTER key represent?
while (1)
if strcmp(get(gcf,'currentcharacter'),'??');
break;
end
end

 采纳的回答

Walter Roberson
Walter Roberson 2017-2-28

0 个投票

Use CurrentKey 'Enter'
Otherwise, char(10)

1 个评论

Hg
Hg 2017-2-28
编辑:Hg 2017-2-28
It seems like char(10) is for Windows. In my case, which is Windows on a Macbook, only char(13) works.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by