필터 지우기
필터 지우기

Simple Question: What is the need for suppressing statements in scripts?

조회 수: 2 (최근 30일)
AStar
AStar 2019년 12월 5일
댓글: Walter Roberson 2019년 12월 5일
Hi, I know we suppress assignment statements in script so we can format the output and also some of the info is unnecessary to the user. However, I was wondering does supressing statements always save memory space?
Thanks
  댓글 수: 4
Guillaume
Guillaume 2019년 12월 5일
For what it's worth, for me the question is a bit strange as I see the default state of code as not outputting to the command prompt and therefore, you enable (don't suppress) output if needed. It's only semantics but reflects a different coding outlook.
Walter Roberson
Walter Roberson 2019년 12월 5일
It can save memory. Every "page" (2D array) that is displayed is formatted consistently when you use format short (the default), and the only way that can happen is if it takes a copy of the slice to find the maximum and minimum absolute values -- a process that takes temporary memory. With sufficiently large arrays, that could add up substantially.
... Of course, with arrays that large, displaying them would be quite time consuming.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by