Could you code this question on Matlab? :)
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
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...
Calculator = 0.01 Calculate . Add O subtract O Multiply ODvide uttons on the right determine the operation that is performed on the numbers. For example, the following image shows values 12 and 3 are entered in the ion in selected. When the Calculate button is pressed, the result of the addition operation is shown after the equal sign ( In this example, the result is 1 Calculator 12 .15.01 Calculate | ⓔAdd subtract。Multiply O Divide g images show the...
PROBLEM STATEMENT The mini-calculator will use a small ALU to perform arithmetic operations on two 4-bit values which are set using switches. The ALU operations described below are implemented with an Adder/Subtractor component. A pushbutton input allows the current arithmetic result to be saved. An upgraded mini-calculator allows the saved value to be used in place of B as one of the operands. The small ALU that you will design will use the 4-bit adder myadder4 to do several possible...