luanjinjin
2012-12-06, 10:13
各位高手,初学matlab,想读取txt文件中数据来画图,txt中有很多行数,把每一行当作不同的y值,x为默认,请问如何编写.m文件,最后.m文件要在vb中调用
ceshujutxt格式如下:
7 6 8 6 6 5 4 2 4 1 1 5 3 1 1
7 6 8 6 6 5 4 2 4 1 1 5 3 1 1 0
7 6 8 6 6 5 4 2 4 1 1 5 3 1 1 0 2
写如下
function ceehuatu()
y=load ('ceshuju.txt');
plot(y);
grid
但运行时说
实时错误‘-2147467259(80004005)’
Error using==>load
Unable to read file ceshuju.txt:NO such file or directory
我的ceshuju.txt在matlab的work下有,但还是出现上述问题,求各位帮忙解决
ceshujutxt格式如下:
7 6 8 6 6 5 4 2 4 1 1 5 3 1 1
7 6 8 6 6 5 4 2 4 1 1 5 3 1 1 0
7 6 8 6 6 5 4 2 4 1 1 5 3 1 1 0 2
写如下
function ceehuatu()
y=load ('ceshuju.txt');
plot(y);
grid
但运行时说
实时错误‘-2147467259(80004005)’
Error using==>load
Unable to read file ceshuju.txt:NO such file or directory
我的ceshuju.txt在matlab的work下有,但还是出现上述问题,求各位帮忙解决