简体   繁体   English

仅提取没有 header - Matlab 的数据

[英]Extract only the data without the header - Matlab

How can I extract only the data without the header?如何在没有 header 的情况下仅提取数据?

clc;
clear all;
 
mt = readtable('messy.csv','TreatAsEmpty',{'.','NA'});
tableHeader = mt.Properties.VariableNames 
tableData = mt(:,:)

Try this if you want to convert a table in an array without headers:如果你想转换一个没有标题的数组中的表,试试这个:

tableData = mt{:,:}

other solution (output -> matrix, get only numbers):其他解决方案(输出 - >矩阵,只获得数字):

tableData = table2array(mt)

other solution (output -> cell, get strings too):其他解决方案(输出 -> 单元格,也获取字符串):

tableData = table2cell(mt)

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

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