How to use subplot within two loops

I need one figure with multiple graphs within two loops.
for i=1:length(state)
[block]
for j=1:length(channel)
[block]
subplot(length(state),length(channel)),j)
plot(a,b)% a and b are arrays of doubles.
end
end
I want one figure with size =length(state)*length(channel); for instance I need all the graphs of state(1)within all channels in the first row etc...
But what I get is multiple figures (the lenght of state).

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 8월 8일
편집: KALYAN ACHARJYA 2019년 8월 8일

0 개 추천

Extra parenthesis here ...
subplot(length(state),length(channel)),j)
%....................................^
Try
l=1;
for....
for..
.....
subplot(length(state),length(channel),l)
plot(a,b) % a and b are arrays of doubles.
l=l+1;
end
end

댓글 수: 1

madhan ravi
madhan ravi 2019년 8월 8일
You mean parenthesis.

이 질문은 마감되었습니다.

태그

질문:

2019년 8월 8일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by