Index in position 2 exceeds array bounds (must not exceed 1).

1 visualización (últimos 30 días)
LAKSHMAN SA
LAKSHMAN SA el 26 de En. de 2021
Respondida: Mahesh Taparia el 28 de En. de 2021
gcf;
subplot(3,1,1)
plot(Y(:,1),Y(:,2))
title('source current')
ylabel('iS in A')
subplot(3,1,2)
plot(Y(:,1),Y(:,3))
title('capacitor voltage')
ylabel('vC in V')
subplot(3,1,3)
plot(Y(:,1),Y(:,4))
title('inductor current')
xlabel('time in sec.')
ylabel('iL in A')
Index in position 2 exceeds array bounds (must not exceed 1).
Error in (line 3)
plot(Y(:,1),Y(:,2))
  2 comentarios
Timo Dietz
Timo Dietz el 26 de En. de 2021
Without knowing Y and what you want to plot exactly, it's hard to help.
Walter Roberson
Walter Roberson el 26 de En. de 2021
Your Y only has one column.

Iniciar sesión para comentar.

Respuestas (1)

Mahesh Taparia
Mahesh Taparia el 28 de En. de 2021
Hi
It seems Y is not defined correctly. Either it is a single column matrix or just a scalar. So assign the value correctly.

Categorías

Más información sobre Two y-axis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by