Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (alexrobin13):

Need help with MatLab coding (Will medal) I'm trying to code for Pascal's triangle (quick Google will explain it). My code is: function[P]=Pascales(n) for i=1:n B(i, 1)=1 for i=2:n for j=2:n B(i,j)=B(i-1,j)+B(i-1,j-1) end end end But I keep getting the error: Index exceeds matrix dimensions. Error in Pascales (line 7) B(i,j)=B(i-1,j)+B(i-1,j-1) Please help.

OpenStudy (rsmith6559):

Are there supposed to be commas between i and j inside the parentheses?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Jalissa21: What does adenoma mea?
8 minutes ago 0 Replies 0 Medals
Twilightt: How Can We Prevent Gun Violence in American Schools?
2 hours ago 2 Replies 1 Medal
Twaylor: possible?
2 days ago 5 Replies 0 Medals
Arriyanalol: hekp
3 days ago 33 Replies 0 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!