I am having problem with input.

My code: s = input('Enter length of side');
Error shown: Attempt to execute SCRIPT input as a function: \\hs8.lboro.ac.uk\psyd3\MATLAB\input.m
Error in IsTriangle_With_Errors (line 5) s1 = input('Enter shortest side of Triangle:');

2 Commenti

Dennis
Dennis il 5 Lug 2018
It seems like you wrote a script named input.m. Try to rename that.
I had written a script input.m, I renamed it. Did not work.
Tried deleting it. Still didn't work

Accedi per commentare.

 Risposta accettata

Rik
Rik il 5 Lug 2018

0 voti

You learned a valuable lesson: don't shadow Matlab functions. You should write functions (or scripts) with names like sum or input etc. You can check if a function exists by a name you're planning to use by entering the name in the documentation search box in the top of your Matlab window, or in the online doc for your release.

5 Commenti

or calling
which function_name -all
I had written a script input.m, I renamed it. Did not work.
Tried deleting it. Still didn't work
Stephen23
Stephen23 il 5 Lug 2018
Modificato: Stephen23 il 5 Lug 2018
@Yash Deshpande: show us the complete output of this command:
which input -all
Sorry, my bad. Got it. I had not deleted properly. It is working now.
Rik
Rik il 5 Lug 2018
BTW, you should be aware that the offline doc search and which only work for the toolboxes you have installed.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Programming in Centro assistenza e File Exchange

Tag

Richiesto:

il 5 Lug 2018

Commentato:

Rik
il 5 Lug 2018

Community Treasure Hunt

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

Start Hunting!

Translated by