This is a very nice, well commented and well structured code!
Your comments in the start are exactly how they should be. You already know this, but I'll say it anyway. Writing a function where you have comments like this in the start aids the user because help functionName will provide the information needed in order to use the function.
There's is only one minor thing I would do differently. You know the end points, and how many steps there are. You have two options:
- Calculate the step-size and use it to create a vector with the correct number of steps using colon
- Just use what you know directly in linspace
Instead of calculating re_step and do reals = limits(1) : re_step : limits(2); you can use linspace:
reals = linspace(limits(1), limits(2), image_size(1));
imags = linspace(limits(4), limits(3), image_size(2));
The following comment is incorrect: "% Transpose so that plot will have reals on the x axis"
You are working with complex numbers, and in those cases, ' is the complex conjugate transpose, not the regular transpose. I don't know if you want the transpose or the complex conjugate transpose, but it's nice to keep in mind.