标签:name 长度 pre fopen for spl file str highlight
FPGA数据录取下来后,通过MALTAB仿真分析,数据提取代码如下:
fileName = ‘1.csv‘; Length = 2048;%录取长度 fd = fopen(fileName, ‘r‘); s = fgets(fd); data = zeros(40, Length); %40为抓取的数据个数,每拍的个数,具体可打开csv分析 for jj = 1:Length s = fgets(fd); pos = (s == ‘,‘); s1 = textscan(s, ‘%s‘); s1 = s1{1,1}; for kk = 4:43 a = s1(kk); a = a{1,1}; a = str2num(a); mm = kk - 3; data(mm, jj) = a; end end data2 = data(:); plot(data2)
标签:name 长度 pre fopen for spl file str highlight
原文地址:https://www.cnblogs.com/mia1004/p/12052053.html