Question

Could you code this question on Matlab? :)

Question: Design a GUI based application, named Calculator, which perform basic arithmetic operations ie., add, subtract, mul

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB CODE:

clc
clear all
close all

a = input('Enter number,a:');
b = input('Enter number,b:');

fprintf('1.Addition\n2.Subtraction\n3.Multiplication\n4.Division\n');
Op = input('Enter number of Operation:');

if Op == 1
    Result = a+b;
    fprintf('%d + %d = %d\n',a,b,Result);
elseif Op == 2
       Result = a-b;
       fprintf('%d - %d = %d\n',a,b,Result);
elseif Op == 3
       Result = a*b;
       fprintf('%d x %d = %d\n',a,b,Result);
elseif Op == 4
       Result = a/b;
       fprintf('%d / %d = %d\n',a,b,Result);
else
    fprintf('Invalid Operator\n');
end

Add a comment
Know the answer?
Add Answer to:
Could you code this question on Matlab? :) Question: Design a GUI based application, named Calculator, which perform basic arithmetic operations ie., add, subtract, multiply, and divide Your design m...
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