Problem in matrix dimension

1 回表示 (過去 30 日間)
Thomas Vescovini
Thomas Vescovini 2019 年 7 月 11 日
コメント済み: Thomas Vescovini 2019 年 7 月 11 日
Hello,
I have some troubles with my code. While i'm trying to open my fire pixels datas, I receive the message "index exceeds matric dimension" but I don't understand where it come from...
9- [contenunum, contenutext] = xlsread('Maghreb_0218.csv');
10-
11- nb=numel(contenunum(:,1));
12-
13- fifi= datevec(contenutext(2:nb+1,6),'dd/mm/yyyy');
14- fifi_lat=str2double(contenutext(2:nb+1,1));
15- fifi_lon=str2double(contenutext(2:nb+1,2));
16- fifi_bright=str2double(contenutext(2:nb+1,3));
17-
18- CAD_FEUX=cat(2,fifi(:,1:3),fifi_lat,fifi_lon,fifi_bright);
Index exceeds matrix dimensions.
Error in MODIS_FEUX (line 11)
nb=numel(contenunum(:,1));
The size of contenunum is 1,10 and contenutext is 1,11.
The thing is the same code is working with the same datas for my colegues but not for me...
Hopefully someone will be able to find the problem...
  3 件のコメント
Alex Mcaulley
Alex Mcaulley 2019 年 7 月 11 日
It seems that contenunum variable is empty
Thomas Vescovini
Thomas Vescovini 2019 年 7 月 11 日
Yes the variable is empty but I don't know why... I have linked the file to this messsage.

サインインしてコメントする。

採用された回答

Andrei Bobrov
Andrei Bobrov 2019 年 7 月 11 日
T = readtable('fire_archive_M6_59116.csv');
a = T.acq_time/100;
T.acq_date = T.acq_date + hours(fix(a)) + minutes(100*mod(a,1));
T.acq_date = datetime(T.acq_date,'F','uuuu-MM-dd HH:mm:SS');
T_out = [T(:,6), T(:,1:3)];
  1 件のコメント
Thomas Vescovini
Thomas Vescovini 2019 年 7 月 11 日
Thanks for the help, I just put the hour out because i don't need it. It works perfectly!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by