mirror of
https://github.com/ChuXunYu/OfficeFileHandle.git
synced 2026-01-31 02:01:26 +00:00
12 lines
406 B
Matlab
12 lines
406 B
Matlab
% 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' 这几列 |