Thread Subject: Publishement of the M-files

Subject: Publishement of the M-files

From: Marwa fahim

Date: 11 Nov, 2009 11:36:34

Message: 1 of 4

hi :) ..

i want that the M-file be published automatically when runed .. so i wrote this code :

%% publishing and displaying a complete report

ans1=mfilename;
ans2=pwd;
publish([ans2 '\' ans1])
ans2=pwd;
web([ans2 '\html\myfile.html'])


but it doesn't work , why ? i'll be thankfull for you and your help :)

best regards :)

Subject: Publishement of the M-files

From: Steven Lord

Date: 11 Nov, 2009 14:34:49

Message: 2 of 4


"Marwa fahim" <papillonrouge1987@hotmail.com> wrote in message
news:hde7k1$m8r$1@fred.mathworks.com...
> hi :) ..
>
> i want that the M-file be published automatically when runed .. so i wrote
> this code :
>
> %% publishing and displaying a complete report
>
> ans1=mfilename;
> ans2=pwd;
> publish([ans2 '\' ans1])
> ans2=pwd;
> web([ans2 '\html\myfile.html'])
>
>
> but it doesn't work , why ? i'll be thankfull for you and your help :)

Part of the publication process involves running the M-file ... which will
cause it to publish itself ... which will cause it to run itself ... which
will cause it to publish itself ... which will cause it to run itself ...
which will cause it to publish itself ... which will cause it to run itself
... you get the picture.

Describe a little more in depth what you're trying to do and someone may
have a suggestion for how to accomplish that goal.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: Publishement of the M-files

From: Marwa fahim

Date: 11 Nov, 2009 17:52:04

Message: 3 of 4

thank you Steven for your reply
i got the point .. u r totally right .. but what is strange : when i wrote the m file including this code , it gave an output : a repot in html format , but without pictures and with this error :
Error in ==> evalmxdom>createThumbnail at 209
            [X,map] = imread(data.pictureList{end});

Error in ==> evalmxdom at 33
createThumbnail(options,data)

Error in ==> publish at 161
    dom = evalmxdom(prefix,dom,cellBoundaries,prefix,imageDir,options);

Subject: Publishement of the M-files

From: Matthew Simoneau

Date: 1 Dec, 2009 21:09:21

Message: 4 of 4

You can definitely call publish from a script. If it is publishing some other script, this works fine. If it is publishing itself, it will recursively try to publish itself. You'd need to turn evalCode to false:

...
opts = [];
opts.evalCode = false;
publish(mfilename,opts)
web(fullfile(pwd,'html',[mfilename '.html']))
...

I don't know why you're seeing this error from createThumbnail. I can help if you give more information.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
publish Marwa fahim 11 Nov, 2009 06:39:05
mfile Marwa fahim 11 Nov, 2009 06:39:05
html Marwa fahim 11 Nov, 2009 06:39:05
report Marwa fahim 11 Nov, 2009 06:39:05
rssFeed for this Thread

Contact us at files@mathworks.com