I am loading a file in matlab, but it is being loaded as an empty variable.
positive 0x0 []
and am using
load positive.txt
but the file is not empty. Is the something am wrong?
P.S. I have loaded other files from the same folder successfully. Also I tried to rename it to positive.dat but that also didn’t work. And it was an excel file that I saved as an text file.
and the first couple entries of the file, copied & pasted
04 10 19
04 10 36
04 10 28
04 16 16
04 14 01
04 20 21
04 20 06
04 20 28
04 13 14
04 13 17
04 13 02
04 01 16
loadcommand is only for MAT-files (file extension.mat) or ASCII files saved in MATLAB format, usually in MATLAB usingsavecommand. For all other file formats you should use some other command.For text files you can use
fopen,fscanf,fclose. For binary files you can usefopen,fread,fclose.fopenopens the file for reading and/or writing,fscanforfreadread data from file (fscanfreads text,freadbinary data) and thenfclosecloses the file.For Excel files you can use
xlsread.xlsreaddoes not needfopenorfclose.