how to solve this question using two loops?
이전 댓글 표시

댓글 수: 2
James Tursa
2015년 4월 17일
편집: James Tursa
2015년 4월 17일
Once you have the formula you can calculate this with MATLAB functions. Other than that, what is the MATLAB related question here? I assume this is homework, so we would appreciate you showing some effort first.
John D'Errico
2015년 4월 17일
편집: John D'Errico
2015년 4월 17일
Anyway, why do you need MATLAB to do this at all? Seems like pencil and paper are sufficient to write down the general formula. Oh, yeah, its homework. So start writing code. Or, think about the problem, and then write down the solution as a simple enough formula.
I'd suggest first thinking along the lines of symmetry. Is there some symmetry in this problem? What does that mean in terms of the solution? (Often symmetries in mathematics are useful tools to reduce the complexity of a problem.)
As well, look at small problems, then see if there is a pattern you might recognize.
채택된 답변
추가 답변 (1개)
Image Analyst
2015년 4월 18일
0 개 추천
Steve Eddins gives an extensive discussion on this in his 5-blog series on this: http://blogs.mathworks.com/steve/2011/11/01/exploring-shortest-paths-part-1/
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!