필터 지우기
필터 지우기

How do i introduce Loop for multiple subplots ??

조회 수: 1 (최근 30일)
Add
Add 2016년 3월 22일
답변: Walter Roberson 2016년 3월 22일
Hey everyone, I wrote this code
close all; clear all;
data=xlsread('DTEC_SGOC_new.xlsx');
% Create figure
figure1 = figure;
% Create subplot
subplot1 = subplot(5,6,1,'Parent',figure1,... 'XTickLabel',{'16','17','18','19','20','21','22'},... 'XTick',[0 120 240 360 480 600 720]);
xlim(subplot1,[0 720]);
ylim(subplot1,[-1 1]);
box(subplot1,'on');
hold(subplot1,'all');
plot(data(:,1)),'r';
Now, I want to repeat this in a for loop for the next 30 subplots plotting each column from my data. How do i do that ??

채택된 답변

Walter Roberson
Walter Roberson 2016년 3월 22일
for K=1:30
subplot1 = subplot(5,6,K,....)
....
plot(data(:, K), 'r') ;
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by