I am working on code that calculates grain sizes (and other things) of different mineral phases and I want it to spit out a table at the end of it with the mean, mode, etc of each phase. I am having trouble populating the "Phase List", which will be the row values of the final table. Green cells in image.
u = unique(grains.phase);
Unable to resolve the name 'grains.phase'.
phase = grains(grains.phase==u(j)).mineral;
phaselist(j,1) = {phase};
The error I get is with the braces and it not populating the cell in phaselist with the phase, which is a character array. I have tried it several ways but get the following:
phaselist(j,1) = {phase};
Conversion to double from cell is not possible.
phaselist{j,1} = {phase};
Unable to perform assignment because brace indexing is not supported for variables of this type.
Any help is appreciated. Thank You.