Matlab中文本数据混合文件的数据读取 发表于 2020-05-13 阅读次数: Valine: 使用textscan 函数读取textscan 函数在matlab中的解释是 “从文本文件或字符串读取格式化数据” textscan 函数读取的结果是个 1*1 的cell数组,可以展开为 N*1 的cell数组,单个字符串或者单个数据占据其中的一个位置。 代码如下所示: 123456clc; clear; close all;fid=fopen('test.s2p'); % open file in read only data = textscan(fid,'%s'); % textscan function read data data = data{:};fclose(fid); 读取后的数据结果: