I'll guess for homework Q? the answer is less esoteric than Walter's take... :)
Yes, if you need more precision than the default display format and the instructor says using the format command to change display mode is not permitted for the assignment, then your supposition of using a formatting string is correct. One supposes the class has recently touched on that topic.
Without giving away the store on writing answer directly, look at one of the following options --
num2str() with an optional formatting string, or
fprintf() using the default 1 for the file ID to echo to the command line (presuming that's where you want the answer to be displayed). A default double has roughly 15 decimal digits of precision; you may have been instructed how many digits to display? Those should give hints on writing/displaying more significant digits...