Ctrl-C in mex not working

6 ビュー (過去 30 日間)
Ian Esten
Ian Esten 2018 年 5 月 10 日
編集済み: Walter Roberson 2025 年 6 月 6 日
Hi,
I am trying to make it possible to break out of my mex function using ctrl-c. I have tried using the undocumented uc MATLAB library (as detailed here: https://undocumentedmatlab.com/blog/mex-ctrl-c-interrupt ), however the sample program does not detect ctrl-c.
I have also tried adding my own SIGINT handler (see: https://linuxtoosx.blogspot.com/2010/10/ctrl-c-signal-catching-from-c-program.html ). This doesn't work either.
I have tried this on macOS 10.13.4, in MATLAB versions 2018a, 2017b and 2016a. I've also tried it on Windows 10 in MATLAB 2018a.
The last posts I see online about this are from 2016. Has anyone had any more recent luck doing this? If so, please advise on how to make it work!
Thanks, Ian
  2 件のコメント
Sid Jhaveri
Sid Jhaveri 2018 年 5 月 14 日
Hi Ian,
I am assuming that you would like to kill the MEX function without killing the MATLAB process. In this case the following link should be useful: https://www.mathworks.com/matlabcentral/answers/221744-killing-a-mex-function-when-it-doesn-t-respond-to-ctrl-c-or-ctrl-break-under-win64?s_tid=answers_rc1-2_p2_MLT
Ian Esten
Ian Esten 2018 年 5 月 17 日
Hi Sid,
Thanks for responding. I am indeed trying to break out of a mex function I am writing without killing MATLAB. The forum link you provided links to variations on the same information in the first link I provided. I have implemented this and am not having any luck in getting it to work, including the demo code that works for others.
Thanks, Ian

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeHistorical Contests についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by