Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在MATLAB中从文件列表打开文件时出现问题_Matlab_Filenames_Fopen - Fatal编程技术网

在MATLAB中从文件列表打开文件时出现问题

在MATLAB中从文件列表打开文件时出现问题,matlab,filenames,fopen,Matlab,Filenames,Fopen,我有一个保存在51X1单元格矩阵中的文件名列表 通过使用和获得 我想使用fastaread或任何其他matlab txt读取函数 读取这些文件 它们的形式如下: C:\Users\mixalic\Desktop\fastasequences\AB062619_FASTA_328312477664609773.txt 问题是当我使用 fastaread(filelist(i)) 我得到以下错误: Error using fastaread (line 53) Input must be a c

我有一个保存在51X1单元格矩阵中的文件名列表 通过使用和获得 我想使用fastaread或任何其他matlab txt读取函数 读取这些文件

它们的形式如下:

C:\Users\mixalic\Desktop\fastasequences\AB062619_FASTA_328312477664609773.txt
问题是当我使用

fastaread(filelist(i))
我得到以下错误:

Error using fastaread (line 53)
Input must be a character array
我试图将我的单元格数组转换为字符数组,但它将只读取C: 并报告:

Error using fastaread (line 158)
Input does not exist or is not a valid FASTA file.
或者当我使用load时:

Error using load
Unable to read file C: No such file or directory.
有什么帮助吗


非常感谢

您应该访问带有花括号的
文件列表的元素。如果使用普通括号,Matlab将返回1x1单元数组

这个

产出:

Name      Size            Bytes  Class    Attributes
bar       1x19               38  char               
foo       1x1               150  cell  

fastaread(文件列表{i})
应该可以工作。如果不存在,请选中
exist(filelist{i},'file')
。谢谢,我最初通过字符转换解决了它,但这样更好
Name      Size            Bytes  Class    Attributes
bar       1x19               38  char               
foo       1x1               150  cell