How to include functions in Matlab Notebook?
4 次查看(过去 30 天)
显示 更早的评论
I suspect there's an obvious answer to this, but if I want to include function definitions in a Matlab Notebook (so the documentation is in Word) how do I do that? Perhaps someone can point me to the spot I've missed in the Matlab documents. Thanks.
0 个评论
回答(3 个)
Image Analyst
2012-11-27
You mean like the "Publish" functionality? In R2012b there is a "Publish" tab if you're in the editor window. Publish existed in earlier versions too - look it up in your help.
Sean de Wolski
2012-11-27
Hi Richard,
I don't believe it is possible to include a function definition in a notebook (though not positive).
What you could do as a workaround is have the function defined in MATLAB and then call
type foo
To have the contents of the function printed.
@IA, Here is some more info on Notebooks. I hadn't learned about them until recently either...
They're pretty cool actually; it's a way that you can evaluate code in Word and have the results printed right it your word doc.
0 个评论
cheng chen
2017-3-14
your matlab "current directory" must include the function what you difined.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!