Filter löschen
Filter löschen

for Loop counting Array

1 Ansicht (letzte 30 Tage)
Qiabin John Su
Qiabin John Su am 17 Mär. 2021
Beantwortet: Star Strider am 17 Mär. 2021
I'm trying to ask the user for an integer input, then store that value as N.
Making a for loop from 1:N creating an array storing elements from 1 to N vertically. like
1
2
3
to N

Antworten (1)

Star Strider
Star Strider am 17 Mär. 2021
I prefer using inputdlg for the inputs. Then see the documentation section on Matrix Indexing to understand how to create the vector.

Kategorien

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

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by