I am new to Matlab and I got a question that I have solved but I think it is wrong. It is supposed to be solved with the Conditional statement if
Question: Write a programme that will keep asking the user of the code to enter a value. The code will return the square root of the entered value. The programme should be implemented using an inifinite for loop that will be broken when the user does not need to enter another value.
a= input ('Enter a value to be square rooted:');
r= sqrt (a);
fprintf ('The square root of %g is:\n', a)
I don't know where to add the if, also, is the if condition the reason while the infinite value will be broken? Thank you