Write a function to evaluate a binary expression character arraywithout directly converting to numeric value. (Matlab)
Solution
Program:
Sample output:
Code to copy:
% EvalBinExp.m
function res=EvalBinExp(binexp)
[m,n]=size(binexp);
num1=0;
num2=0;
% process the character array, character bycharacter
for i=1:n
% continue, until thecharacter is not a binary operator
if binexp(i)>=48&&
OR
OR