Index in position 1 exceeds array bounds. Index must not exceed 1200. i am getting this error.

2 vues (au cours des 30 derniers jours)
I want matlab to collect all the 1201 no data of 117 csv files on that folder and make a new csv file which will do as the new features.
close all
clear all
file_location ='D:\Conference August\Data\0_Subjects_Empty Room' ;
emptyroomdata = fileDatastore(fullfile(file_location),'ReadFcn',@importdata,'FileExtensions','.csv')
fullFileNames = emptyroomdata.Files ;
numfiles = length(fullFileNames)
data = readall(emptyroomdata) ;
maxi = [];
mini = [];
kur = [];
ske = [];
stan = [];
for k = 1:numfiles
h = data{k,1}.data(1201,:) ;
maxx = max(h) ;
minn = min(h) ;
kurt = kurtosis(h) ;
skee = skewness(h) ;
stdd = std(h) ;
maxi = [maxi, maxx] ;
maximum = maxi.' ;
mini = [mini, minn] ;
minimum = mini.' ;
kur = [kur, kurt] ;
kurto_sis = kur.' ;
ske = [ske skee] ;
skew_ness = ske.' ;
stan = [stan, stdd] ;
standard_deviation = stan.' ;
end
  4 commentaires
irteeja akik
irteeja akik le 29 Août 2022
Index in position 1 exceeds array bounds. Index must not exceed 1200.
Error in inporting_sorting_xcels (line 18)
h = data{k}.data(1201,:) ;
it says this

Connectez-vous pour commenter.

Réponses (1)

Cris LaPierre
Cris LaPierre le 29 Août 2022
Position 1 is your row index. Apparently, data only has 1200 rows, and your code is trying to extract row 1201.
% simple example
a = [1 2;3 4]
a = 2×2
1 2 3 4
% works
a(2,:)
ans = 1×2
3 4
% your error
a(3,:)
Index in position 1 exceeds array bounds. Index must not exceed 2.

Catégories

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

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by