Hello

This is an example document.

Contents

Patients

Create a table from individual workspace variables.

load patients
patients = table(LastName,Gender,Age,Height,Weight,Smoker,Systolic,Diastolic);

Select the rows for patients who smoke, and a subset of the variables.

smokers = patients(patients.Smoker == true, {'LastName' 'Gender' 'Systolic' 'Diastolic'})
smokers = 

     LastName       Gender     Systolic    Diastolic
    ___________    ________    ________    _________

    'Smith'        'Male'      124         93       
    'Miller'       'Female'    130         88       
    'White'        'Male'      130         95       
    'Martin'       'Male'      130         92       
    'Thompson'     'Male'      124         95       
    'Garcia'       'Female'    123         79       
    'Lee'          'Female'    128         90       
    'Walker'       'Female'    129         96       
    'King'         'Male'      127         89       
    'Wright'       'Female'    134         92       
    'Baker'        'Male'      136         90       
    'Nelson'       'Male'      124         90       
    'Mitchell'     'Male'      128         92       
    'Roberts'      'Male'      132         89       
    'Turner'       'Male'      137         96       
    'Collins'      'Male'      124         78       
    'Stewart'      'Male'      129         95       
    'Sanchez'      'Female'    130         91       
    'Morris'       'Female'    132         91       
    'Reed'         'Male'      129         89       
    'Bell'         'Male'      138         82       
    'Ramirez'      'Female'    138         82       
    'Watson'       'Female'    122         91       
    'Sanders'      'Female'    125         85       
    'Price'        'Male'      124         84       
    'Jenkins'      'Male'      134         82       
    'Long'         'Male'      125         92       
    'Patterson'    'Female'    135         92       
    'Hughes'       'Female'    128         96       
    'Flores'       'Female'    123         87       
    'Butler'       'Male'      138         90       
    'Alexander'    'Male'      128         99       
    'Russell'      'Male'      124         92       
    'Diaz'         'Male'      136         93       

Convert the two blood pressure variables into a single variable.

patients.BloodPressure = [patients.Systolic patients.Diastolic];
patients(:,{'Systolic' 'Diastolic'}) = [];

Pick out two specific patients by the LastName variable.

patients(ismember(patients.LastName,{'Smith' 'Jones'}), :)
ans = 

    LastName     Gender     Age    Height    Weight    Smoker    BloodPressure
    ________    ________    ___    ______    ______    ______    _____________

    'Smith'     'Male'      38     71        176       true      124     93   
    'Jones'     'Female'    40     67        133       false     117     75