Disabling the Keyboard with the Matlab command
5 次查看(过去 30 天)
显示 更早的评论
Hello everyone I have two following question:
1- I want to give someone my code (in the protected file) so I used the matlab command of "pcode". I also don't want that the user be able to stop the code by pressing the "Ctrl+C", which means I want to run the code completely. What do I have to do?
2- Is there any command line that help me to not give the error details (just mention the line number on which the error occured) if either the user stop the code or there is a problem?
Any help is appreciated Thanks in advance
0 个评论
采纳的回答
Guillaume
2014-11-8
There is a also the oncleanup callback that can be executed whenever your function ends, regardless of the reason.
There is no way to prevent the user from stopping your code and there shouldn't be.
I would strongly advise you to rethink your strategy though. The less user friendly your code is, the less inclined the user will be to use it. If you catch error messages it should be to better explain what went wrong, not to hide it.
I also worry that a) you want to prevent errors being display, indicating that your code may not always work as it should and b) prevent the user to stop your code if it goes wrong. What if your code goes into an infinite loop?
You've encrypted your code, so the user cannot look at the source code anyway. You should leave at that. Or if you do catch errors / invoke cleanup functions, it should be for the right reasons: make your code more robust.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!