Complaint from a matlab user about Operation termination!!
Afficher commentaires plus anciens
When I have run the matlab for a while, I terminated the program since I found a bug. Then nothing appeared in the workspace. I believe it is not a convenient way. I should check some data when I terminated at the same time. The only way is to trace some data into a file when the program begins. sigh
Réponse acceptée
Plus de réponses (2)
Jan
le 21 Déc 2011
2 votes
I agree the program you are using has a bad design. If it is a function and you have to terminate it by Ctrl-C, all performed work is lost.
I assume the programmer did not expect the user to kill the process. If a premature program termination can be expected, a GUI containing a "Terminate" button should offer a clean way to stop the execution. The program has to check the status of the button (or use any other method for message passing) and reply and useful data after cleaning up.
I do not understand, why you ask this here. Contacting the author of the program will be more helpful. Ask for an improved usability, especially some progress information and the possibility for a premature termination.
Be aware, that it is impossible for Matlab to perform all required and wished tasks automagically for you, because Ctrl-C is the brute way to stop all executions. Even a smart cleanup would be interupted!
2 commentaires
dai zhengguo
le 21 Déc 2011
Malcolm Lidierth
le 21 Déc 2011
Look in the MATLAB help under "scope"
kumar verma
le 16 Nov 2015
Modifié(e) : Walter Roberson
le 16 Nov 2015
0 votes
wtf...when im typing sin(pi) im getting ans as 1.2246e-16 fine ..later i tried if x 0:pi/2:pi sin(x) i got ans 0 1 0......why ...wats the problem....should i write exam or not...plzz help me.... literally suffering a lot because of this problem...today 14:00 i should give my paper,... please reply asap...
thanks in advance
1 commentaire
Walter Roberson
le 16 Nov 2015
>> x = 0:pi/2:pi; sin(x)
ans =
0 1 1.22464679914735e-16
This is due to the fact that pi cannot be exactly represented in binary floating point numbers. However, you will find that sind(180) is 0 exactly because 180 is exactly representable in binary floating point and sind() checks for the multiples of 90 as a special case.
If you happened to work symbolically,
x = sym('pi'); sin(x)
then you would get 0 exactly because the symbolic toolbox is not limited to binary floating point numbers.
Catégories
En savoir plus sur Entering Commands dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!