필터 지우기
필터 지우기

How to have only one output from each cell ? (Live Scripts)

조회 수: 15 (최근 30일)
Enrique
Enrique 2022년 11월 15일
댓글: Enrique 2022년 11월 17일
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
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)])
We have this formula: tanh(x)
Enrique
Enrique 2022년 11월 15일
Sorry If I haven’t explained my self properly . I would like to have have a single output in which it is included all the output contents from the cell .
I don’t like the fact that when a plot is displayed or I write a disp() function the code gets split .

댓글을 달려면 로그인하십시오.

채택된 답변

Chris
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.
  댓글 수: 1
Enrique
Enrique 2022년 11월 17일
Thanks for your help! Perhaps I only need to get used to live scripts

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by