You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
330 B
Matlab

function saveData(Lon, Lat)
% 将两个数组转置为列向量
col1 = Lon(:);
col2 = Lat(:);
% 将2个列向量连接成矩阵?
matrix = [col1, col2];
% 打开文件以进行写入?
outFileID = fopen('output.txt', 'w');
% 将矩阵写入文件?
fprintf(outFileID, '%d %d\n', matrix');
% 关闭文件
fclose(outFileID);
end