Reputation: 363
For example, let's say I have the following commands
a= [ 1 2 4 ];
length(a)
sum(a)
When I use publish
I want to have the following:
length(a)
ans =
3
sum(a)
ans =
7
Right now, I have the commands first and then the answers.
Upvotes: 0
Views: 28
Reputation: 3071
On publish
, the answers shown for each code section.
To insert a new code section, use %%
like that:
a = [1 2 4];
length(a)
%%
sum(a)
So in file the answers will separated:
Upvotes: 3