필터 지우기
필터 지우기

For loop inside a loop

조회 수: 1 (최근 30일)
Lucy Davidson
Lucy Davidson 2020년 3월 24일
댓글: darova 2020년 3월 24일
For my code it is already in a loop n=1:6
but i am making a subpots with the code shown below but i want to insert another loop it so i don't have to write the labels in each line of code and the 'subplot'. i was trying to make a new loop (t=1:4) and then do (subplot(2,4,t)) but the error said dox indexing would not support this.
I have inserted a picture of my code and an example of one of the graphs, can anyone help?
  댓글 수: 1
darova
darova 2020년 3월 24일
Can you attach the code using

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

답변 (1개)

Peng Li
Peng Li 2020년 3월 24일
It is difficult to understand where your error occurs, and it is difficult to know what variable types are.
Based on your code snapshot, you have used variable "t" for something else. If you use it as a loop variable, it conflicts with this t you have used.

카테고리

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