필터 지우기
필터 지우기

Write a script that uses a for loop to calculate the product of the negative numbers between -1 and -53, in increments of -4 (−1, −5, · · · , −53).

조회 수: 1 (최근 30일)
I know how to create the number sequence its just a=(-53:4:-1) but I can't figure out how to multiply all of them together.

답변 (1개)

Walter Roberson
Walter Roberson 2018년 1월 24일
Example:
Number = 1;
for K = 1 : 10
Number = Number * (K*2+1);
end
  댓글 수: 4
Elias Beaini
Elias Beaini 2018년 1월 24일
i don't know how to modify this code to the specific question. i have to compare the results to the prod command and i know how to do that

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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by