I am loading a file in matlab, but it is being loaded as an empty variable.
positive 0x0 []
and am using
load positive.t
load
command is only for MAT-files (file extension .mat
) or ASCII files saved in MATLAB format, usually in MATLAB using save
command. 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 use fopen
, fread
, fclose
. fopen
opens the file for reading and/or writing, fscanf
or fread
read data from file (fscanf
reads text, fread
binary data) and then fclose
closes the file.
For Excel files you can use xlsread
. xlsread
does not need fopen
or fclose
.