| 查看: 791 | 回复: 0 | |||
wj0702114081金虫 (正式写手)
学神的奴隶
|
[求助]
想用matlab编一个读取实验数据的程序,用textread。
|
|
实验采集了一大堆数据,现在要对数据进行处理。 文件名是不规律的。 我的想法是,先把这个文件夹内的所有文件名读取进matlab。 然后设置一个循环,按照次序把文件名的每一个值赋值给textread。 想法比较简单,但是一直不成功啊。textread这个命令不太会用。 现在贴上程序,希望大神答疑解惑。 clc; clear all; close all; %% --get filename-- filepath='C:\Users\Jie\Desktop\Recent Files'; file=dir(filepath);%data file location filename0={file.name};%read the file name of the data file filename=filename0(3:end);%remove the first and second useless filename‘.’and‘..’ [m,n]=size(filename); filesize=n;%read the total file number %% --readdata from file-- cd(filepath) for i=1:n a1=textread(filename(i)); end 数据运行完是这样: 未定义与 'cell' 类型的输入参数相对应的函数 'exist'。 出错 textread>noargname (line 190) arg = f(arg); 出错 textread (line 157) if (noargname(@exist,varargin{1}) ~= 2 || noargname(@exist,fullfile(cd,varargin{1})) ~= 2) ... 出错 readdata (line 16) a1=textread(filename(i)); |
» 猜你喜欢
遇见不省心的家人很难过
已经有16人回复
退学或坚持读
已经有25人回复
博士延得我,科研能力直往上蹿
已经有4人回复
免疫学博士有名额,速联系
已经有14人回复
面上基金申报没有其他的参与者成吗
已经有4人回复
多组分精馏求助
已经有6人回复

找到一些相关的精华帖子,希望有用哦~
Matlab如何读取中括号内的数据
已经有8人回复
matlab读取excel多个sheet数据,处理并重新保存,高价求教高人
已经有12人回复
Matlab读取多个文件中某一列的最大值然后输出到一个txt中
已经有8人回复
matlab读取多个数据
已经有6人回复
关于使用matlab批量读取图片的问题
已经有8人回复
用matlab读取TXT文本其中一列的数据!
已经有11人回复
从excel读取数据多项式拟合出错
已经有3人回复
科研从小木虫开始,人人为我,我为人人













回复此楼
点击这里搜索更多相关资源