Question

MATLAB ONLY PLEASE...ALSO AS SIMPLE AS POSSIBLE...NEW TO LANGUAGE Write a code that will ask the...

MATLAB ONLY PLEASE...ALSO AS SIMPLE AS POSSIBLE...NEW TO LANGUAGE

Write a code that will ask the user to input a positive number x.

If the number is negative the program will keep asking again and again (as long as the value is negative) until the user inputs a positive value. At the end of the program, calculate the following:

y = e-x

0 0
Add a comment Improve this question Transcribed image text
Answer #1
x=input('Enter x: ');
while x < 0
x=input('Enter x: ');
end
y=e-x;
disp(y)
plot(x,y)

octave: X11 DISPLAY environment variable not set octave: disabling GUI features Enter x: -22 Enter x: 1 Enter x: 6 -3.2817

Add a comment
Know the answer?
Add Answer to:
MATLAB ONLY PLEASE...ALSO AS SIMPLE AS POSSIBLE...NEW TO LANGUAGE Write a code that will ask the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT