- Go to Edit Publishing Options
- In Code Settings, set "Include Code" to false
How to publish a table and graph?
6 ビュー (過去 30 日間)
古いコメントを表示
I have written code that takes a time series and produces a table of the inputs using the function array2table as well as a graph of the data simply using the plot command. I want to publish these outputs yet MATLAB keeps returning errors when I try to run the publish command. How can I transform the plot and/or graph to allow the publish command to publish the results?
(As a simple example, take
vect = [1 2 3 4];
tableVect = array2table(vect);
How can I publish tableVect?)
0 件のコメント
回答 (1 件)
Aniket
2025 年 6 月 11 日
I understand that you are creating some tables and plots in the workspace and want to publish them.
The publish command is used create formatted documents using the plain text MATLAB Code files (.m). This command does not accept workspace variables as arguments.
As a workaround, you may skip the semicolon on the lines you want to display in published document as in below code:
vect = [1 2 3 4];
tableVect = array2table(vect)
plot(vect);
This will display tableVect as well as the plot in published document.
If you do not want to have code in the published document, follow these steps:
This ensure only the results (workspace variables in this case) are published.
Please find more details regarding "Output Settings for Publishing" in this documentation: https://www.mathworks.com/help/matlab/matlab_prog/specifying-output-settings-for-publishing.html
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!