MATLAB Answers

Conversion Wolfram Mathematica to Matlab (Do loop)

조회 수: 4(최근 30일)
Juan Angel
Juan Angel 2021년 8월 23일
댓글: Juan Angel 2021년 8월 24일
Hello!. I'd like to ask for your help please. This is just a question from an extremely simple Mathematica code, and I just want to know how I could convert it to the Matlab language:
Clear[sum, n]
sum = 0;
Do[sum = sum + n, {n, 1, 100}]
Print[sum]
Thank you very much!
  댓글 수: 2
Juan Angel
Juan Angel 2021년 8월 24일
Thank you!

댓글을 달려면 로그인하십시오.

답변(1개)

James Tursa
James Tursa 2021년 8월 23일
result = sum(1:100);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by