Hiding only a section of code in live script.

36 ビュー (過去 30 日間)
andrea
andrea 2020 年 4 月 5 日
コメント済み: Giulio Suzumura 2020 年 5 月 26 日
Hi everyone,
Is there a way to hide not all the code of the live script but only some section ??

回答 (2 件)

Sean de Wolski
Sean de Wolski 2020 年 4 月 8 日
Put the code you don't want displayed in a separate function that's called from the main live script.
  1 件のコメント
Giulio Suzumura
Giulio Suzumura 2020 年 5 月 26 日
Tks!
I reduce all my plots to one line!
On live preview:
printplots({img1,img2,img3},{'Image 1','Image 2','Image 3'});
printplots.m function
function imprimir(plots,names)
qntPlots = size(plots,2);
qntNames = size(names,2);
if qntPlots ~= qntNames
error("Needs to be same size");
end
figure();
for i = 1:qntPlots
s = subplot(1,qntPlots,i); imshow(plots{i})
s.Title.String = names{i};
%...
end
set(gcf,'Position',[0 0 1200 3*100])
set(findall(gcf,'-property','FontSize'),'FontSize',16)
%...
end

サインインしてコメントする。


Payas Bahade
Payas Bahade 2020 年 4 月 8 日
Hi Andrea,
While this feature is not currently available for the Live Editor, the development team has been made aware of this request and they may consider adding it for a future release of MATLAB.
Similar question has been answered in the community with a possible workaround. Please refer this link to view that question.
Hope this helps!

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by