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

1 view (last 30 days)
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

Answers (1)

Matt J
Matt J on 2 Mar 2020
You may think EE is 10x51, but it is not...

Tags

Community Treasure Hunt

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

Start Hunting!