• 2021-04-14
    阅读并运行代码,完成问题: clear;clc; Gender = ["male";"female";"male";"female";"male"]; Smoker = logical([1;0;1;0;0]); Weight = [176;163;131;133;119]; T = table(Gender,Smoker,Weight); %按性别和吸烟状况分组,计算平均体重 G = groupsummary(T,{'Gender','Smoker'},'mean','Weight') 则男性吸烟的平均体重为(单位为磅)
  • 举一反三