What type of array should I use to combine numerical values and string values and have the ability to sort them in octave/matlab -


i'm trying link numerical (octave/matlab) values in array string values in array how can go doing this. reason i'm trying sort array based on numerical values.

example:

array=[1,2,'filename1';3,4,'filename2';5,6,'filename3'] (i know incorrect , give error)

this i'm trying can sort based on first or second column , have third column "linked" / follow sort. (please note numbers not sequential sequence 1,2,3... used example)

1,2,filename1 3,4,filename2 5,6,filename3 

if sort first numerical column in descending order should this

5,6,filename3
3,4,filename2
1,2,filename1

how can go doing , still values of array individually? example: array(1,1) 5 , array(3,3) filename1

if want know, plan on creating playlist of wavfile names based on sort. ps: i'm using octave/matlab

you can use 2 separate arrays, 1 2 columns of number , 1 strings. when sort first array based on first number, function return both sorted list reordered indices. can use reordered indices rearrange strings. this:

[sort_list, indx] = sort(array1, 1); array_string = array_strings[indx]; 

i don't think access in way possible. maybe can similar cells more expensive using 2 arrays.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -