can anyone find the error?

1 view (last 30 days)
Pawan Acharya
Pawan Acharya on 23 Oct 2020
Commented: Sindar on 24 Oct 2020
and after RUN

Accepted Answer

Sindar on 23 Oct 2020
Perhaps you are calling the function with two few arguments, such as this on the command line:
If you are simply hitting the "Run" button, then the program assumes no inputs at all, and b happens to be the first one it comes across.
Neither of these are bugs in the code, simply incorrect usage. If you want to prevent this, define defaults:
function quadraticc(a,b,c)
a (1,1) double = 1
b (1,1) double = 0
c (1,1) double = 0
Sindar on 24 Oct 2020
you aren't calculating r when k<0, but you still try to display it

Sign in to comment.

More Answers (1)

KSSV on 23 Oct 2020
Edited: KSSV on 23 Oct 2020
Save the function in a folder...and :
a = 1 ;
b = 2 ;
c = 3 ; % define your variables


Find more on Graphics Object Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!