From: Markthomas on
I am having a problem plotting data, it seems that the data I want to use isn't sorted. I have 2 columns of data; y,T. I can load the data file into Matlab but is there a way i can sort the data based on y? It is crucial that the y(1) stays with T(1) and so forth.

thanks

MT
From: ade77 on
"Markthomas" <uebermenchens(a)yahoo.com> wrote in message <hqn2b1$oj9$1(a)fred.mathworks.com>...
> I am having a problem plotting data, it seems that the data I want to use isn't sorted. I have 2 columns of data; y,T. I can load the data file into Matlab but is there a way i can sort the data based on y? It is crucial that the y(1) stays with T(1) and so forth.
>
> thanks
>
> MT


doc sort

sort, then use logical indexing
From: Walter Roberson on
ade77 wrote:
> "Markthomas" <uebermenchens(a)yahoo.com> wrote in message
> <hqn2b1$oj9$1(a)fred.mathworks.com>...
>> I am having a problem plotting data, it seems that the data I want to
>> use isn't sorted. I have 2 columns of data; y,T. I can load the data
>> file into Matlab but is there a way i can sort the data based on y?
>> It is crucial that the y(1) stays with T(1) and so forth.

> doc sort
>
> sort, then use logical indexing

Or use sortrows()