How to publish as pdf from command tab
17 ビュー (過去 30 日間)
古いコメントを表示
I have a function which I am running from command window as follows.
[logical_out, run_time, reaction_time] = reaction_time_function4('alexis', '11-Feb-2022', 'Trial27')
But when I try to save the result as pdf in the command window using
publish('reaction_time_function4.m','pdf');
it throws me an error.
data_on_date = sorted_data(sorted_data.date == char(day),:);
Basically I have to hard code the function which I want to avoid. (Because it will be more time consuming)
When I try to add the publish command in the function it throws me the same error.
Is there any work around this?
0 件のコメント
採用された回答
Steven Lord
2022 年 4 月 22 日
To do this using the publish function use the codeToEvaluate name-value pair argument as shown in the "Generate HTML View of MATLAB function with Input Arguments" example on the publish documentation page.
その他の回答 (1 件)
Sean de Wolski
2022 年 4 月 22 日
Open the function and go to the publish tab in the toolstrip. From there, click the dropdown under the publish icon for settings. Change the function call in the "MATLAB Expression:" to be: [logical_out, run_time, reaction_time] = reaction_time_function4('alexis', '11-Feb-2022', 'Trial27')
Then hit publish.
2 件のコメント
Sean de Wolski
2022 年 4 月 25 日
Sorry, it's "Options" not settings, the second item in the dropdown. You can also select "PDF" as the output format in there.
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!