Filter löschen
Filter löschen

readcell command undefined?

14 Ansichten (letzte 30 Tage)
Amit Ifrach
Amit Ifrach am 13 Okt. 2021
Kommentiert: Mathieu NOE am 14 Okt. 2021
לק"י
Hi guys,
I try to use readcell command, but it seems it is not recognized by matlab. i thought it may be an external function which needs to be downloaded, but as far as I could tell, it an official function of mathworks.
the code line:
tmp = readcell(fullfile(fileDir, fileNames_sorted{k}));
the error I get:
>> readcell(fullfile(fileDir, fileNames_sorted{k}))
Undefined function or variable 'readcell'.
Thanks!
Amit.

Akzeptierte Antwort

Mathieu NOE
Mathieu NOE am 13 Okt. 2021
hello again Amit
i think I recognize this line of code... :)
I believe readcell was introduced around R2018 - so if you have an older release I changed the code from readcell to csvread which is much older but still working - there are probably other options also like csvimport
NB : with csvread make sure you have the right amount of header lines defined
% tmp = readcell(fullfile(fileDir, fileNames_sorted{k})); % original code
tmp = csvread(fullfile(fileDir, fileNames_sorted{k}),1); % 1 headerline skipped / csvimport should also work
  3 Kommentare
Amit Ifrach
Amit Ifrach am 14 Okt. 2021
Bearbeitet: Amit Ifrach am 14 Okt. 2021
לק"י
Hi mathieu, helping me again :)
thanks mate!
Mathieu NOE
Mathieu NOE am 14 Okt. 2021
My pleasure !

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by