Re: sort arrays based on names [message #71369] |
Thu, 17 June 2010 13:04  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Jun 17, 4:39 pm, Hassan <hkhav...@gmail.com> wrote:
> when I use Sort() it returns me integer values instead of sorting
> strings.
sort() gives the indexes of the elements in the order that would make
the array sorted. That is:
s=sort(a) ;Finds the sort order for array a
b=a[s] ;b is a sorted
|
|
|
|
|
|
|
|
Re: sort arrays based on names [message #71396 is a reply to message #71392] |
Wed, 16 June 2010 23:54   |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Jun 16, 3:30 pm, Hassan <hkhav...@gmail.com> wrote:
> Hi,
> I have five arrays (ns=10,nl=20) with the following names:
> c:\test\red1.img
> c:\test\red10.img
> c:\test\red2.img
> c:\test\red11.img
> c:\test\red3.img
> I want to make a new file which containes all files but in order like:
> new_array=(10,20,5)
> (following expression just show that I want to have the first image in
> the first layer of my new array)
> new_array(*,*,0) =c:\test\red1.img
> new_array(*,*,1)=c:\test\red2.img
> new_array(*,*,2)=c:\test\red3.img
> new_array(*,*,3)=c:\test\red10.img
> new_array(*,*,4)=c:\test\red11.img
>
> Any help please?
big=make_array(10,20,5)
big[*,*,0]=red1
big[*,*,1]=red2
big[*,*,2]=red3
……..
|
|
|
|