• 大小: 702 Bytes
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-12-28
  • 语言: Matlab
  • 标签: matlab  

资源简介

读取txt文件内容matlab代码实现。本资源中包括了.txt测试文档和matlab代码示例。

资源截图

代码片段和文件信息

clear all;
close all;
clc;

ffid_ERS = fopen(‘circleCenter_ERS.txt‘‘r‘);

%输入数据:ffid
ffid = ffid_ERS ;
%输出数据:XYRtO imgName

%读入.txt文件数据到cell对象中
i = 0;
tline1 = cell(1001);%定义cell对象
while feof(ffid) == 0
    i = i+1;
    tline1{i1} = fgetl(ffid);
    %      tline = fgetl(ffid);
end
numImg=i;
imgName = cell(numImg1);
XYRtO   = zeros(numImg5) ;
%从cell读写中读入数据到特定的数据变量
for i=1:numImg
    tline=tline1{i1} ;
    [XYRtO(i1) XYRtO(i2) XYRtO(i3) XYRtO(i4) XYRtO(i5) imgName{i1}]...
        = strread(tline‘%d %d %d %d %d %s‘);
end
%输出数据
imgName_ERS = imgName;
XYRtO_ERS   = XYRtO;


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        664  2017-10-09 18:59  analysiseLocation.m

     文件        282  2017-10-09 15:50  circleCenter_ERS.txt

----------- ---------  ---------- -----  ----

                  946                    2


评论

共有 条评论