MATLAB: What part of the code do i change to print the triangle flipped

for loopfprintfMATLAB

Hey so i am trying to print this triangle
, but I only got this far
What do I need to change in my code in order to flip it?
n=input('Enter rows for left triangle');
for i=2:n+1
for j=1:i-1
fprintf('*');
fprintf('');
end
fprintf('\n');
end

Best Answer

n=input('Enter rows for left triangle\n');
for i=1:n
for j=1:i
x(i,j) = '*';
end
end
disp(fliplr(x));