t*****e 发帖数: 2228 | 1 多谢,还是不行
>> M = dlmread('def.dat', '', 5, 2);
Error using dlmread (line 141)
Mismatch between file and format string.
Trouble reading number from file (row 1u, field 14u) ==> 我数据里有几列是字
符串
M = csvread('def.dat', 5, 2);
Error using dlmread (line 141)
Number of HeaderColumns is greater than number of columns in file.
Error in csvread (line 50)
m=dlmread(filename, ',', r, c);
不知道错哪里了.
还有一个更重要的问题. 我的主要任务是把一个sas project 在matlab里实现,把sas
data读入matlab只是第一步. sas里用的是proc genmod link = logit etc 那我
matl... 阅读全帖 |
|
d****e 发帖数: 251 | 2 dlmread will do the job of "option 1"
dist_matrix = dlmread('filename') % by default the delimiter is whitespace
% ignore first column
dist_matrix = dlmread('filename',' ',0,1) |
|
|
h******g 发帖数: 11250 | 4 我一般都前面加一个输入,要求知道行数
如果不知道行数
土办法,不知道是否可行
while (feof(fid)~=1)
dlmread (i,....)
i=i+1 |
|
|
s*****o 发帖数: 1262 | 6 昨天尝试把很多新的m file放在一个目录下,一开始那些function都可以调用,虽然会
出错,后来忽然就不行了,说undifined variable or function ‘xxx’。
现在,连这样简单的m file都不能执行了(以前可以的):
data=dlmread('11-34-22.txt','\t',1,0);
dt=1/25;
time=dt:dt:length(data)*dt;
orange=[1.0 0.5 0.2];
plot(time,data(:,3),'r');
hold on;
plot(time,data(:,4),'Color',orange);
plot(time,data(:,5),'y');
plot(time,data(:,6),'g');
plot(time,data(:,7),'b');
hold off;
报错,说undifined function or variable 'test.m'
请问除了什么问题? 我都没有define function 阿,只是执行一系列储存在mfile里的
命令而已阿 |
|
s*****c 发帖数: 753 | 7 fprintf? 读?
Have you tried fscanf with %f? How about csvread or dlmread?
If you really was reading it in as a string (assume it is stored in A) and
then parsing the string to get the value, can't you parse A(1:end-1)? |
|
s*****c 发帖数: 753 | 8 This symbol is ascii code 12, or form feed. \f
Try to use dlmread with ',\f' as delimiter. |
|
s*****c 发帖数: 753 | 9 fprintf? 读?
Have you tried fscanf with %f? How about csvread or dlmread?
If you really was reading it in as a string (assume it is stored in A) and
then parsing the string to get the value, can't you parse A(1:end-1)? |
|
s*****c 发帖数: 753 | 10 This symbol is ascii code 12, or form feed. \f
Try to use dlmread with ',\f' as delimiter. |
|
u*****3 发帖数: 796 | 11 csvread/dlmread 指定从第二行开始读。
char |
|