怎么将matlab中数据保存为txt或dat格式
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/11 05:09:35
怎么将matlab中数据保存为txt或dat格式
a =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
保存后在文本文件中显示成
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
程序要怎么写,
以下这种不行,
a =[17 24 1 8 15;23 5 7 14 16 ;4 6 13 20 22 ;10 12 19 21 3 ;11 18 25 2 9 ]
save afile.txt -ascii a
afile.txt打开之后,是这样的:
1.7000000e+001 2.4000000e+001 1.0000000e+000 8.0000000e+000 1.5000000e+001
2.3000000e+001 5.0000000e+000 7.0000000e+000 1.4000000e+001 1.6000000e+001
4.0000000e+000 6.0000000e+000 1.3000000e+001 2.0000000e+001 2.2000000e+001
1.0000000e+001 1.2000000e+001 1.9000000e+001 2.1000000e+001 3.0000000e+000
1.1000000e+001 1.8000000e+001 2.5000000e+001 2.0000000e+000 9.0000000e+000
a =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
保存后在文本文件中显示成
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
程序要怎么写,
以下这种不行,
a =[17 24 1 8 15;23 5 7 14 16 ;4 6 13 20 22 ;10 12 19 21 3 ;11 18 25 2 9 ]
save afile.txt -ascii a
afile.txt打开之后,是这样的:
1.7000000e+001 2.4000000e+001 1.0000000e+000 8.0000000e+000 1.5000000e+001
2.3000000e+001 5.0000000e+000 7.0000000e+000 1.4000000e+001 1.6000000e+001
4.0000000e+000 6.0000000e+000 1.3000000e+001 2.0000000e+001 2.2000000e+001
1.0000000e+001 1.2000000e+001 1.9000000e+001 2.1000000e+001 3.0000000e+000
1.1000000e+001 1.8000000e+001 2.5000000e+001 2.0000000e+000 9.0000000e+000
try this:
>> dlmwrite('a.txt',a,'delimiter',' ','newline','pc')
>> !type a.txt
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
%read Matlab help to see the usage of function dlmwrite.
>> dlmwrite('a.txt',a,'delimiter',' ','newline','pc')
>> !type a.txt
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
%read Matlab help to see the usage of function dlmwrite.
怎么将matlab中数据保存为txt或dat格式
请问matlab中怎么将数据保存为.dat格式
如何将.txt文件中的数据导入Matlab,存入数组中,数组为A[22,3]
matlab怎么将已知函数曲线导成txt数据
MATLAB中单摆怎么保存成gif格式的
MATLAB 中有两个变量的函数怎么保存数据?
matlab里面如何将每次计算得到的数据(一个数)保存在矩阵中
matlab读取txt文档数据
matlab 读取txt文档数据
VB程序题,已知有一个数据文件data.dat,请编写程序将data.dat中的数据复制到文件student.dat中去
matlab怎么保存为.m文件?
matlab中读txt文件中的数据,总是出现Error:Unexpected MATLAB operator,程序如下