Pyramid Table script code
Show older comments
I would like to make a triangle like this one using these source codes that I made already:
function pyramid(a)
for b = 1:a
base = (sqrt(3)*b)/2;
height = 1 - (b * 3/2)
c = [-base base 0 -base];
d = [height height 1 height];
plot(c,d); hold on
end
this only plots the structure of the triangle
how do i make it plot like that? (with inner triangles)

Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!