This solution is outdated. To rescore this solution, sign in.
-
3 Comments
Samidha Banka
on 19 Jan 2018
Simple, yet nice.
Luyu Wang
on 8 Jul 2018
I solved it bot by the best algorithm.
Ashish Patil
on 2 Aug 2018
I also used this one. but while using other methods(not optimized), when i tried commands mentioned below, it gave "failed" status.
Can anybody tell why?
function t = triangle(n)
y= x:-1:1;
y= sum(y)
end
Suggested Problems
-
Determine whether a vector is monotonically increasing
21347 Solvers
-
7726 Solvers
-
1937 Solvers
-
Getting the indices from a vector
10377 Solvers
-
756 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!