How to Publish matlab outout and code in pdf.

Hello, How i can publish matlab output and code ".m file" into pdf format.
Thanks

1 Comment

I have a MATLAB code which generates a .txt file. Now I want to publish the code and the output text in a pdf format. Is it possible?
Currently I am able to publish only the code in the pdf format, but not the output text with it.

Sign in to comment.

 Accepted Answer

Try this :
publish('myfile.m','pdf')
Remark: The default file format is .html
Read the link below for better understanding:

27 Comments

@Muhammad did it work?
hello thanks for the reply. and my apology for late reply. this command is not working. https://www.youtube.com/watch?v=NN65DNIDjR0&t=320s
I want to publish code and output. like in this video. but i am not able to do this. I am only able to publish the code not the graphs.
Thanks
It's working for me(even the graph), ok lets try this can you see an option as publish near editor.
let me know when you come to this step
publish button, but it is only publishing the code itself. i want to have graphs published with the code.
click edit publishing button under publish button
the example given by you is working for me. but not in case of my file which i have to submit. :(
what is your email id
Can you upload your file so that we can try and I'll convert it ?
i can email not upload here.
hello , have you got email.
check your mail @Muhammed ,if it is what you were looking for please accept my answer
yes, but it not working for me here.
Please let me know. I was using the publish button. it was not working on my code. , only publishing code, not the graphs.
did you check it( above comment) now?
yes , but not working for me. what have you done.
I am doing the same steps. and can you please delete the file from here Please
yes this is working for me
Hello @ madhan ravi. Thanks for the help. can you please help
syms x
f =x.^2
fplot(f)
t = 1: 256
how i can ply. publish graph and not the output of
t = 1: 256
thanks
t=1:256;
just suppress the output by putting semicolon(;)

Sign in to comment.

More Answers (4)

bruh
dont use publish('myfile.m','pdf') if youre using the matlab online version
it crashed my computer opening so many figue pages hahahaha
computing average marks of a student?

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!