This is bigger than I initially thought. At first I was thinking a one line fix for 4.4, but there is more to it. Yes, there is one detail that just doesn't make sense with regard to common definitions. Here is fixed point with 5 fractional digits (and is sort of what what Matlab is doing with its "4 digits after the decimal point"):
The following would be 5 significant digits, something similar to floating point
Then for the sake of space, at either extreme one might use engineering notation rather than such a long string of numerals.
Octave is following a floating point progression at the start, then transitions to a fixed point progression at the following point:
Why should the larger number get more fractional resolution? That's the one point I disagree with. Just how many significant digits there are, whether it is fixed point or floating point is all a matter of choice.
I can see where this gets more complicated, if one considers groups of numbers. For example, the following illustrates that it is the smallest number of the group that governs the overall fractional digits:
Or more precisely, governed by whatever number has the most fractional digits. In the following there are numbers greater than that transition point mentioned above; they therefore have five digits to the right of the decimal point):

I'm not doing anything more about this for 4.4.
For 5.0, maybe we should decide what behavior we really want to have, define that precisely, then try to make it happen.

I agree that the use of the terms precision or "significant figures" is sloppy, so the documentation could use some work.
But the values shown aren't wrong, are they? I don't think we are displaying more digits than are valid for the computed values.

Well, I'd say that current behavior is wrong, no matter the interpretation. I'm not a real stickler for exact compatibility, but the issue here is that Matlab appears to be saying nothing about "precision" or (what Octave states in the documentation) "with 5 significant figures". To me, "significant figures" can only be interpreted as precision, and Octave is sort of doing that in the first half of the progression below. Anyway, Matlab just says "4 digits after the decimal point". Perhaps once that no longer makes reasonable sense, then it switches to exponent notation.

After reverting the changeset mentioned in comment #3, the behavior is
so that's not it.
What's weird about the Matlab behavior is that it sometimes shows just a few nonzero digits, but always 4 after the decimal until it would need more than 7. Whatever. The "best" behavior here is pretty subjective.

fyi matlab 2017a switches to scientific notation:

Ah, OK, thanks for the clarification. This then probably goes back to this changeset:
Changeset:
24789 (a4d4ec566fd7) improve formatting of large values in proutput functions …
http://hg.savannah.gnu.org/hgweb/octave/rev/a4d4ec566fd7
I'll leave this for someone else to investigate.

In previous versions of Octave:
I believe Matlab also switches to scientific notation when the range of the value exceeds the output precision setting.

Here's a changeset that will address this bug, but the fix may not be 100% accurate as to what the intended behavior is. It procudes
which shows how the right side digits is eventually discarded. Note in the changeset that I actually chose the ld and rd to reflect the scientific or engineering understanding of "precision", not the computer/C interpretation. Here's the formula change:
where my expectation was that ld limited to prec (i.e., 5) would create
ans = 33333000
rather than
ans = 33333333
as an example; but obviously it doesn't do that. In some sense, what I intended could be a desirable behavior for those who want to present data in a paper or something and limit the precision to, say, three digits without having to do the rounding manually. Do something manually always opens the door for mistakes so why not let the computer do the rounding?
Nonetheless, I suspect the that ld precision is interpreted in a C sense at the following point in the code:
So, there are a few questions, the most primary being what the output should do in terms of "precision". It might be good to create a set of tests with perhaps fifty examples of all the various formats...in string format, then just output the result to a string and compare. If the attached change is small enough and fixes an obvious bug, then apply as it is, but in the long run this may need a more extensive review.
(file #43963)

It caught my attention that the output format is displaying too much precision for numbers that have magnitude greater than the number of digits of precision, stated imprecisely. That is, notice the progression:
that once the left digits hits 5 the right digits jumps back up to five.
Here are some related bug reports, but they aren't quite the same issue:
https://savannah.gnu.org/bugs/?func=detailitem&item_id=53456
https://savannah.gnu.org/bugs/?func=detailitem&item_id=41359
