Dear community, I hope you can help me with this issue:
I need to subplot 3 graphs. Each graph has 2 variables and I need that appears with the same x variable (in this case is "time"). T_A8_C is mean of measurements and T_A8_D is mean of other measurements, and so on. I need 3 subplots: first: T_A8_C with T_A8_D, second: T_C5_C with T-C5_D and third: T_E1_C with T_EA_D
I have this commands:
subplot(2,1,1)
x = linspace(0, 130, numel(T_A8_C));
X = [x;x].';
YA8 = [T_A8_C(:) T_A8_D(:)];
plot(X,YA8)
subplot(2,1,2)
YC5 = [T_C5_C(:) T_C5_D(:)];
plot(X,YC5)
subplot(2,1,3)
YE1 = [T_E1_C(:) T_E1_D(:)];
plot(X,YE1)
err=[T_desvA8_C(:) T_desvC5_C(:) T_desvE1_C(:) T_desvA8_D(:) T_desvC5_D(:) T_desvE1_D(:)];
errorbar(X,Y,err)
hEB=errorbar(X,Y,err);
hEB(1).Color=('red');
hEB(2).Color=('blue');
hEB(3).Color=('black');
hEB(4).Color=('red');
hEB(5).Color=('blue');
hEB(6).Color=('black');
hEB(1).LineStyle=('-');
hEB(2).LineStyle=('-');
hEB(3).LineStyle=('-');
hEB(4).LineStyle=('-.');
hEB(5).LineStyle=('-.');
hEB(6).LineStyle=('-.');
hEB(1).LineWidth=(2);
hEB(2).LineWidth=(2);
hEB(3).LineWidth=(2);
xticks(0:5:130);
title('Cell Temperature Plot')
xlabel('Time (Days)')
ylabel('Cell Temperature (°C)')
legend('A8 Clean','C5 Clean','E1 Clean','A8 Dirty','C5 Dirty','E1 Dirty');
And this message error appears:
Error using subplot (line 332)
Index exceeds number of subplots.
Error in Prueba_TCell (line 79)
subplot(2,1,3)
And doesn´t show the title, labels of each axis, the characteristic width and linestyle and legend.
Please help me with this. =(
Thank you so much!
0 Comments
Sign in to comment.