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 Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by