MATLAB: Change value of states “active” to 1 and “rest” to -1

arraycellcell arraysmatrix manipulationtable

1.JPG
I have attached a mat file for your reference.

Best Answer

stats.state(ismember(stats.state,'rest'),:) = '-1';
stats.state(ismember(stats.state,'active'),:)= '1'