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 =
'********'

采纳的回答

Fangjun Jiang
Fangjun Jiang 2018-2-23
编辑:Fangjun Jiang 2018-2-23
TriangleA(10);
Add the semicolon ; at the end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by