mirror of
https://github.com/ChuXunYu/OfficeFileHandle.git
synced 2026-01-31 02:01:26 +00:00
1
This commit is contained in:
12
xlsx2csv/csv_output/1.m
Normal file
12
xlsx2csv/csv_output/1.m
Normal file
@@ -0,0 +1,12 @@
|
||||
% 1. 清空环境变量
|
||||
clear; clc;
|
||||
|
||||
% 2. 读取数据
|
||||
% detectImportOptions 可以自动识别列名和格式
|
||||
opts = detectImportOptions('male_cleaned.csv');
|
||||
opts.VariableNamingRule = 'preserve'; % 保持列名原样 (避免 GA 变成 Var1)
|
||||
data = readtable('male_cleaned.csv', opts);
|
||||
|
||||
% 3. 预览数据 (检查 GA 列是否正常)
|
||||
head(data)
|
||||
% 务必确认 data 中包含 'Y_Conc', 'GA', 'BMI' 这几列
|
||||
Reference in New Issue
Block a user