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

1 vue (au cours des 30 derniers jours)
Tina Barsoumian
Tina Barsoumian le 2 Mar 2020
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

Réponses (1)

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

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by