Filter löschen
Filter löschen

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 Ansicht (letzte 30 Tage)
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.

Antworten (1)

Walter Roberson
Walter Roberson am 24 Jan. 2018
Example:
Number = 1;
for K = 1 : 10
Number = Number * (K*2+1);
end
  4 Kommentare
Elias Beaini
Elias Beaini am 24 Jan. 2018
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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by