using publish with a function rather than script
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to know if I can use matlab's publish functionality to generate a pdf report via a function call. So basically I have a function f , which does plotting and has latex code and I want to do something like
publish(f(a,b),'output.pdf')
Can matlab's publish function do that ?
0 Kommentare
Antworten (1)
Joseph Cheng
am 25 Sep. 2015
yes it can. follow my example:
so i started a function called plotme()
function plotme(A,B)
figure,plot(A,B)
then to publish this function i need to set the options
options = struct('format','pdf','codeToEvaluate','plotme(1:10,1:10)')
and then i can go
publish('plotme.m',options)
1 Kommentar
Joseph Cheng
am 26 Sep. 2015
Bearbeitet: Joseph Cheng
am 26 Sep. 2015
forgot to mention if you're not trying to do automatically when you run a script or other function. the publish gui/app is much easier to work with.
AND the options strings are case sensitive (at least when i tried) codetoevaluate was different than codeToEvaluate.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!