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

조회 수: 1 (최근 30일)
Tina Barsoumian
Tina Barsoumian 2020년 3월 2일
답변: Matt J 2020년 3월 2일
I am struggling to get the indexing to match up, though I am not really sure what the problem is. When I run the code below, I get the error Index in position 1 exceeds array bounds (must not exceed 1).
EE_DATA.mat is .mat file that is a 10x51 double
function RBE500_tabarsoumian_HW5
%--------------------------
%--------------------------
%obtaining values from simMechanics
[AVelocity,LVelocity,points,t] = simMechanicsData;
%there is more in this function, but this is where I get the error;
end
function [AVelocity,LVelocity,points,t] = simMechanicsData
% simMechanics Model - EE data taken from professor
EE=load('EE_DATA.mat');
%defining variables
LVelocity = EE(5:7,:);
AVelocity = EE(8:10,:);
t = EE(1,:);
points=length(out.EE_Position_Velocity);
end

답변 (1개)

Matt J
Matt J 2020년 3월 2일
You may think EE is 10x51, but it is not...

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by