I don't see the point of outlawing feval.
The question is not clear at all! What is that the poster wants us to do?
The assignment is to "... create a function that operates on two arguments, performing one of the operations 'plus', 'minus', 'times', 'power', 'ldivide' or 'rdivide' (specified as the 3rd argument), after it has matched the sizes of first two input arguments."
So you have to make a functions that performs one of the basic math operations on two input arguments, and which operation it should be is determined by the 3rd input argument.
You are lucky that nowadays Matlab itself tries to match the size of the input arguments of those operations. So if you add a scalar to a vector, the program is that smart that it uses the scalar term for all vector terms. And when the 1st argument is a column vector, it is used for all columns of matrix when the 2nd argument is a matrix that has an equal number of rows as the column has.
When this 'problem' was created, Matlab did not do that by itself, and you had to take care of that yourself.
So the problem is is even easier than you may think. See 'help ops' for basic math in Matlab.
Reverse Run-Length Encoder
Is A the inverse of B?
Return the first and last characters of a character array
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
Fibonacci-Sum of Squares
Insert structure in a parameter-cell array.
Wayfinding 4 - Crossing, level 2
Bleed non-zeros to the right using REGEXP, and that sort of cheatcodess...
Wayfinding 5 - Travel contour
Mmm! Multi-dimensional Matrix Multiplication
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office