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)
Afficher commentaires plus anciens
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
Image Analyst
le 29 Août 2022
What does this say?
s = size(data{k}.data)
Invest some time here:
Réponses (1)
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]
% works
a(2,:)
% your error
a(3,:)
0 commentaires
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!