Re: left adjusting the matrix with unique elements



Jos,

You nailed it!!!Can I ask you for one further help??I will really
appreciate it.

Now how do I replace each number with corresponding alphabet...I mean
replace 1 with "A", 2 with "B", 3 with "C", 4 with "D" etc...Any neat
way to do it??

thanks

Jos wrote:


monarc wrote:

< discussion of problem

you may turn to sort

% an example
A = [1900 1 0 2 0 3 ; 1901 0 0 0 0 1 ; 1902 1 2 3 0 4] ;

B = A(:,2:end) ;
B(B==0) = inf ;
B = sort(B,2) ; % sort each row
B(isinf(B)) = 0 ;
B = [A(:,1) B] ;

hth
Jos
.



Relevant Pages

  • Re: VC++ endless task
    ... Be aware you'll have to run these as state machines, ... If you do go with multithreading, ... send some sort of events, or messages from one thread to the other. ... HTH, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Can I use a variable as a sort key in VB?
    ... that rather than asking the user which column they want to sort by how ... "Bob Phillips" wrote: ... >>> Dim mynumber ... >>> HTH ...
    (microsoft.public.excel.programming)
  • Re: Sorting problem
    ... Abha wrote: ... Obj is a 16*100 matrix which I sort as given above. ... sB = B; % re-align B ... Thank you Jos. ...
    (comp.soft-sys.matlab)
  • Re: License problem, MCE 2005 reinstall
    ... Yes, it's a PITA, but if you just do what it says, it doesn't take long ... HTH, ... sort of code and to call Microsoft. ... I added a new video card and NIC to my machine and got the warning the the ...
    (microsoft.public.windows.mediacenter)
  • Re: finding bottom
    ... A quick question tho'. ... Jos wrote: ... > Ian wrote: ...
    (comp.soft-sys.matlab)