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
-
1357 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3390 Solvers
-
Make a vector of prime numbers
801 Solvers
-
Matlab Basics - Absolute Value
635 Solvers
-
1020 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!