How to publish text and pictures in a loop
5 次查看(过去 30 天)
显示 更早的评论
I want to make a simple catalog over screen clips, which I captured with the Windows 7 Snipping Tool. That's simple with a for-loop, I thought. That would output text, picture, text, picture, etc. However, the script below produces a block of text followed by the pictures. (R2012a).
Next, I included the text in the figure with the function, title. However, I have set a max width as an publish option. In many cases that made the text unreadable small.
Using the errordlg to show the text is not attractive.
Have I missed an option in publish?
Is there a simple work around?
%%Snipping Tool clips
file_spec = fullfile( folder_spec, '*.png' );
sad = transpose( dir( file_spec ) );
for sa = sad
fprintf( '%s | %8u | %s\n', datestr(sa.datenum,31), sa.bytes, sa.name )
... create a figure with an axes
pic = imread( fullfile( folder_spec, sa.name ), 'png' );
imagesc( pic )
end
采纳的回答
Sean de Wolski
2013-7-29
is a code secton break. You can find more information on it here:
You may also be interested in snapnow() to force publish to take a snapshot.
doc snapnow
1 个评论
jfaulhab
2018-12-13
Is there also a way to publish picture, text, picture, text... inside a loop? Normally with snapnow, the figure is placed at the bottom of the section. Any idea how to accomplish this?
Many thanks in advance!
更多回答(1 个)
per isakson
2012-7-8
编辑:per isakson
2013-8-8
8 个评论
francesco
2013-7-22
Yes, I think this is the only to overcome the problem. Thank you very much for your help ! Best regards
Peter
2013-7-29
And something else to watch out for: Following this answer I discovered (2012b) that a try catch block around the section ment to flush the figures is a problem. For me, I had to remove the try catch, otherwise the %% had no effect in within the loop.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Results, Reporting, and Test File Management 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!