Solved

MATLAB-STRUCTURES

Posted on 2001-07-30
8
912 Views
Last Modified: 2008-01-09
How can I sort the rows of a structure based on 3 of its columns?
0
Comment
Question by:kaushalshah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 4

Expert Comment

by:prashant_n_mhatre
ID: 6335625
kaushal:

can you please give feedback for earlier posts?
0
 

Author Comment

by:kaushalshah
ID: 6340912
Thank you for the earlier answers .Do you know how to sort structures?
0
 
LVL 4

Expert Comment

by:prashant_n_mhatre
ID: 6341463
If you are happy with earlier answers, can you please close those questions?
Sorting structures.... we can help you for sure. Can you please elaborate on this
because your question is not clear to me. (i.e. what you meant by "based on 3 of its columns"?)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:kaushalshah
ID: 6342297
I will close them.

This is a sample of the structure:

Fieldname1 Fieldname2 Fieldname3 Fieldname4      Fieldname5
num1a        num2a      strnum3a2    strnum4a3      num5a
num1b        num2b      strnum3b1    strnum4b3      num5a
num1c        num2c      strnum3c2    strnum4c2      num5a

*num stands for just a number
*strnum stands for (abc_ghi_123.jkl)

i need to sort this structure by the num in strnum(2 columns) and num in another column.(ie)under fieldname3,the values should be rearranged as:

strnum3a1
strnum3a2
strnum3a2.
this should affect the rearranging of corresponding rows in other columns.then when sorting by the num in fieldname4 it should look like this :

strnum3a1  strnum4a3
strnum3a2  strnum4a2
strnum3a2  strnum4a3

finally another sort is done by fieldname1 which is a number.

please reply if you need more clarification.

my e-mail address is suetibu@hotmail.com

i appreciate all the responses.
0
 
LVL 4

Expert Comment

by:prashant_n_mhatre
ID: 6344737
Sorting array of structures is not difficult. In any sorting, two things are important.
(1) KEY
(2) SWAPPING VALUES

I hope you are familiar with 'C'. See these two references:

Arrays of Structures

http://www-ee.eng.hawaii.edu/~tep/EE150/book/chap12/section2.1.2.html

Sorting Arrays of Structures
http://www-ee.eng.hawaii.edu/~tep/EE150/book/chap12/section2.1.3.html

I'm sure you will be able to do this. If you could not, please post whatever you did and we'll help to fix the problems(if any).
0
 
LVL 4

Expert Comment

by:prashant_n_mhatre
ID: 6355854
Kaushal:
Any update?
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7487658

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7518825
Per recommendation, points NOT refunded and question closed.

Netminder
EE Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about a problem I had getting the GPS LocationListener working.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Six Sigma Control Plans
Progress

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question