Hi all,(adsbygoogle = window.adsbygoogle || []).push({});

Can someone please help me with my matlab code. I am trying to get the program to quite if the user tries to input a non-numeric value, and will display an error message. I have got it to work useing the matlab input('promt','s') command, but i dont want to use this command because a user cant enter 5/100 etc.

Here is my code.

I would just like to know if there is a simply way to do this, if not I will use the command I used before and use the eval function I think...Code (Text):j = input('number?:')

if isnan(j)==1

disp('Input must be a number, Function will terminate')

return

end

Thank You

Regards Elbarto

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab input function

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads - Matlab input function | Date |
---|---|

Python How can I run Python by getting values from Matlab | Mar 7, 2018 |

What is each step of this Matlab program doing? | Feb 21, 2018 |

C/++/# Help with MATLAB code? | Feb 9, 2018 |

Numerical Integration with variable limits MATLAB | Jan 15, 2018 |

C/++/# Question about input format file (for creating a net) | Dec 13, 2017 |

**Physics Forums - The Fusion of Science and Community**