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

1 次查看(过去 30 天)
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