Write a set of instructions in MATLAB to make a function rect_area having two input arguments a and b and one output argument area A. code example
Example 1: declaring a function in matlab
%%%% general syntax %%%%%%%%%%%%%
function [return parameters] = name_of_function(attributes)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
body_of_the_function
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
Example 2: function maltab
function ave = average(x)
ave = sum(x(:))/numel(x);
end