博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
matlab fscanf
阅读量:3905 次
发布时间:2019-05-23

本文共 330 字,大约阅读时间需要 1 分钟。

clear all;clc;fid=fopen('data1.txt','r');%通过fopen创建fidi=1;while ~feof(fid)%~feof(fid)循环到文件结束处    name(i,:)=fscanf(fid,'%5c',1);% '%5c'表示读取字符的位数(5位)其他的不读取,1->表示读取的个数    year(i)=  fscanf(fid,'%d',1);    no1(i)=fscanf(fid,'%d',1);    no2(i)=fscanf(fid,'%d',1);    no3(i)=fscanf(fid,'%g',1);    no4(i)=fscanf(fid,'%g\n');    i=i+1;end

转载地址:http://bxmen.baihongyu.com/

你可能感兴趣的文章
Python yield and iterables
查看>>
Python string find
查看>>
del Statement
查看>>
Python Dict all
查看>>
Python Rate Limiter
查看>>
Python list to string
查看>>
Python list dict iteration
查看>>
Linux basic knowledge
查看>>
Difference Between Hard & Soft Links
查看>>
Linux Hard link and Symbolic link
查看>>
Hard Link Vs Soft Link
查看>>
redis brief intro
查看>>
mongo db brief intro
查看>>
Kafka basic intro
查看>>
Python multiprocessing
查看>>
Python urlib vs urlib2
查看>>
Python producer & consumer
查看>>
Queue.Queue vs collections.deque
查看>>
Python condition
查看>>
Python Lib Queue.py
查看>>