I have a simple MATLAB script that prints some text and displays numbers in a loop, e.g.
for i = 1:3 x = randn(100, 1); fprintf('Mean = %.2f\n', mean(x)); fprintf('Std = %.2f\n', std(x)); figure; plot(cumsum(x)); end
I want to use the publish function to create an HTML file containing the output of this script, with text and numbers alternating as they are in the loop, that is, they order that they appear in the output, there should be
- Text from the first cycle
- Figures from the first cycle
- Text in the second cycle
- Figures of the second cycle
- Text from the third cycle
- Figures from the third cycle
However, the output is currently displayed in the following order
- Text from the first cycle
- Text in the second cycle
- Text from the third cycle
- Figures from the first cycle
- Figures of the second cycle
- Figures from the third cycle
How can I achieve the desired result?
matlab
Chris taylor
source share