简体   繁体   English

关于用 textscan 在 matlab 中读取数据

[英]about reading data in matlab with textscan

korea ocean information.韩国海洋信息。

data contents is数据内容是

detect : uido
detect_date : 2015-07-19
detect_adress : uido ocean
lon :  34, 32, 35
lat :  125, 48, 10
num detect_date     water_temperature(℃)    Maximum wave height(m)  temperature(℃)  atmospheric pressure(hPa)   Wind direction(16points)    wind speed(m/s) 
0   2015/12/31 23:00    10.57   -   -   -   -   -   
1   2015/12/31 22:00    10.68   -   -   -   -   -   
2   2015/12/31 21:00    11.13   -   -   -   -   -   
3   2015/12/31 20:00    11.68   -   -   -   -   -   
4   2015/12/31 19:00    11.63   -   -   -   -   -   
5   2015/12/31 18:00    11.76   -   -   -   -   -   
6   2015/12/31 17:00    11.64   -   -   -   -   -   
7   2015/12/31 16:00    10.78   -   -   -   -   -   
8   2015/12/31 15:00    10.61   -   -   -   -   -   

i want read data so我想读取数据所以

file_path = './uido/';
filename = 'uido_2015-01_2015-12.txt';
file_id = fopen(filename,'r');

C = importdata(fn);
header = split(C(6),'\t');
format = repmat('%s', [1 length(hdr)]);

D = textscan(file_id, format, 'headerlines', 6, 'Delimiter', '\t');

i think delimiter is tab so i wrote like that.我认为分隔符是制表符,所以我是这样写的。 but result are not split.但结果没有分裂。 what should i do?我该怎么办?

JUST..只是..

hdr = split(C(6));

HAHA哈哈

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM