필터 지우기
필터 지우기

for Loop counting Array

조회 수: 1 (최근 30일)
Qiabin John Su
Qiabin John Su 2021년 3월 17일
답변: Star Strider 2021년 3월 17일
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

답변 (1개)

Star Strider
Star Strider 2021년 3월 17일
I prefer using inputdlg for the inputs. Then see the documentation section on Matrix Indexing to understand how to create the vector.

카테고리

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