Is it possible to add an ouptput, which says what operation made the function, to this following function?
function [op] = operation( A,B )X=[A+B; A-B; A/B; A*B; B-A; B/A;]Y=X(randperm(6),:)if Y(1,1)>0 && Y(1,1)==int16(Y(1,1)) op=Y(1,1);else operation(A,B)endend
For example,
EDU>> operation(4,2) ans= 6
The output is 6, wa all knows that the function did 4+2=6, but how to add the output '+' . For example output:
op = 6 s = +
Best Answer