Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to use subplot within two loops

1 Ansicht (letzte 30 Tage)
Hinde essmahi BOUZIANE
Hinde essmahi BOUZIANE am 8 Aug. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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).

Antworten (1)

KALYAN ACHARJYA
KALYAN ACHARJYA am 8 Aug. 2019
Bearbeitet: KALYAN ACHARJYA am 8 Aug. 2019
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 Kommentar
madhan ravi
madhan ravi am 8 Aug. 2019
You mean parenthesis.

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by