Notes, assignments, and code for NEUROBIO 735 (Spring 2018).
1/10 – 2/8:
Wednesday, Thursday
3:00 – 4:30
DIBS conference room
Consider the table below:
Mouse | Genotype | Rotarod | Tail Suspension | Drug | Age |
---|---|---|---|---|---|
1 | WT | 15.14 | 35.1 | Yes | 25 |
2 | KO | 11.51 | 10.2 | No | 26 |
3 | WT | 12.22 | 25.1 | Yes | 25 |
3 | WT | 17.07 | 22.7 | No | 25 |
3 | WT | 11.81 | 31.6 | Yes | 25 |
categorical
in Matlab?
animal
and treatment
and sorts the rows by animal
and then by treatment
within animal
. Assume animal
and treatment
are existing categorical variables.
tbl = table(animal, treatment);
sortrows(tbl, {'animal', 'treatment'});
tbl = table(animal, treatment);
sortrows(tbl, animal, treatment);
dat = table(animal, treatment);
sortrows(tbl, {'animal', 'treatment'});
dat = table('animal', 'treatment');
sortrows(dat, {'animal', 'treatment'});
tbl = table(animal, treatment);
sortrows(tbl, 'animal', 'treatment');
last
that returns the final element of an array?
last = @(A) A(end);
last = function(A) A(end);
last = function(A)
return A(end);
end
@last(A) A(end);
last = function(A)
last = A(end);
end