How to remove the display of ans on a function
조회 수: 1 (최근 30일)
이전 댓글 표시
I did this function to draw a triangle for a homework. How do I remove "ans=" from the display window?
function [s] = TriangleA(n)
%fhdfh
x = [];
for i = 1 : n;
x = strcat(x,'*');
s = [blanks(n-i) x];
disp(s)
end
>> TriangleA(8)
*
**
***
****
*****
******
*******
******
ans =
'********'
댓글 수: 0
채택된 답변
Fangjun Jiang
2018년 2월 23일
편집: Fangjun Jiang
2018년 2월 23일
TriangleA(10);
Add the semicolon ; at the end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!