I'm trying to create a for loop that will print:
A=1 3 5
6 8 10
11 13 15

1 commentaire

Adam
Adam le 4 Sep 2019
Modifié(e) : Adam le 4 Sep 2019
Why do you need a for loop and where do you want to print it to? If A is definied in the workspace then just
A
will print it to command line.

Connectez-vous pour commenter.

Réponses (1)

Star Strider
Star Strider le 4 Sep 2019

0 votes

Try this:
for k = 1:3
V = (1+5*(k-1)):2:5*k
end
Experiment to get the result you want.

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Produits

Version

R2018a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by