Assuming by other columns, you mean other columns of da.mat
itself, you may try this -
[val,ind] = sort(da.mat(:,1))
da.mat = da.mat(ind,:)
da.rid = da.rid(ind)
If you are looking to use some other column number instead of 1
for sorting and based on the names in the field cid
, use this -
cid_matchcol = 'A02'; %// column name to be used from `da.cid` to choose column of `da.mat`
base_col = find(strcmp(da.cid,cid_matchcol),1)
[val,ind] = sort(da.mat(:,base_col))
da.mat = da.mat(ind,:)
da.rid = da.rid(ind)