MATLAB how to make loop that user keeps pressing a negative number

Code with C | Programming: Projects & Source Codes Forums MATLAB MATLAB how to make loop that user keeps pressing a negative number

This topic contains 2 replies, has 3 voices, and was last updated by  Abhey 3 years, 8 months ago.

  • Author
    Posts
  • #7719

    ShikhaTan
    Member

    How do I keep looping so that if the user keeps pressing a negative number it keeps displaying the message “error”?

  • #7720

    Adan
    Member

    you have to do is to give an initial value to V0 for instance: V0=-1
    and then run the loop(put the whole code inside this loop)

  • #7721

    Abhey
    Member

    If i keep inputting a negative answer it keeps repeating which i want
    but if i run the program from the beginning and input a vale >0 for V0 it jsut falls through and gives an answer for theta without asking for the x value

You must be logged in to reply to this topic.