Even the code for the assignment operator "=" is copyrighted by MathWorks. Of course you can use the results obtained by this operator for a scientific publication. If you are correct, you mention in your paper, that the results have been obtained by Matlab RXYZ.
You are allowed to use high-level functions as ODE45 also to produce and publish results. But you are not allowed to publish the code of ODE45 or claim, that you have written it. It does not matter, if the code is part of the official toolboxes or of an example in the documentation.
If you have to publish the code you have used for the calculations, contact MathWorks directly and ask them explicitly. See the "Contact Us" link on this page.