Please help me solving this matlab code. Thats how the answer should look like:-

1 commentaire

Cris LaPierre
Cris LaPierre le 14 Sep 2020
It looks like you forgot to share your code.

Connectez-vous pour commenter.

 Réponse acceptée

Image Analyst
Image Analyst le 14 Sep 2020

0 votes

Hint: input(), rem(), sprintf(), while
message = sprintf('>>>>> Enter an integer (0-9)\n blah blah fubar snafu lorem ipsum : ');
Change message passed to input depending on what their input was.
response = '0';
message = sprintf(.....
while response ~= 'x'
response = input(...........
if................
message = ...........
elseif ...........
end
end
See if you can finish it.

5 commentaires

Ilmiat
Ilmiat le 15 Sep 2020
What is 'x' here?
Image Analyst
Image Analyst le 15 Sep 2020
Did you see your prompt? It says "To exit the program, enter x". So when input() captures the character(s) the user types, we need to check if that character is x or not, right? At least that's how I read it. So, anyway, what do you have so far?
Ilmiat
Ilmiat le 17 Sep 2020
Ilmiat
Ilmiat le 17 Sep 2020
Can you kindly just say what should I use for string and complex part? isstr, isreal are not working.
elseif imag(p) ~= 0

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur App Building dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by