MATLAB: Trying to print a triangle on screen

for loopfprintfMATLAB

I'm trying to print a triangle like this
but i get this
my code works to make the triangle, but i need it flipped. what part of my code do i edit to do this
n=input('How many rows for right justified triangle do you want ');
for i=2:n+1
for j=1:i-1
fprintf('*');
fprintf('');
end
fprintf('\n');
end

Best Answer

n=input('How many rows for right justified triangle do you want ');
for i=1:n
str = [blanks(n-i) repelem('*',1,i)] ;
fprintf('%s\n',str) ;
end