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

조회 수: 1 (최근 30일)
LAKSHMAN SA
LAKSHMAN SA 2021년 1월 26일
답변: Mahesh Taparia 2021년 1월 28일
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
Timo Dietz
Timo Dietz 2021년 1월 26일
Without knowing Y and what you want to plot exactly, it's hard to help.
Walter Roberson
Walter Roberson 2021년 1월 26일
Your Y only has one column.

댓글을 달려면 로그인하십시오.

답변 (1개)

Mahesh Taparia
Mahesh Taparia 2021년 1월 28일
Hi
It seems Y is not defined correctly. Either it is a single column matrix or just a scalar. So assign the value correctly.

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by