How to have only one output from each cell ? (Live Scripts)
조회 수: 33 (최근 30일)
이전 댓글 표시
I am starting to create new scripts using the live editor .I will like to have one output per cell (like in jupyter notebook) and I haven't found out a simple way to do it. I don’t like that the code gets split to provide an output on the middle of the cell .
As an example , I provide the following representation . I would like to have a unified output after each cell.
syms x
f = tanh(x);
ezplot(f,[-10,10]);
disp(['We have this formula:'])
f
Thanks for your help !!
댓글 수: 2
Dyuman Joshi
2022년 11월 15일
I am not sure what you mean by one output per cell.
Is this what you are looking for?
syms x
f = tanh(x);
disp(['We have this formula: ' char(f)])
채택된 답변
Chris
2022년 11월 15일
편집: Chris
2022년 11월 15일
These are "sections" in Matlab parlance, because "cell" is taken.
There are three display modes for live scripts which can be toggled with squares somewhere in the editor (probably to the right of the script):
You could put all your commands on one line for the "Output inline" option:
ezplot(f,[-10,10]); disp(['We have this formula:']);f
Or choose the "Hide code" option to group the output together, and copy the code into a text block (but that's not beautiful).
Or select "Output on right" to have the output in a separate column.
I've worked around this behavior without realizing it was bothersome, but I think you'll need to submit a feature request to have it work exactly as you want.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Live Scripts and Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!