[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
Solved

# MATLAB-STRUCTURES

Posted on 2001-07-30
Medium Priority
916 Views
How can I sort the rows of a structure based on 3 of its columns?
0
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

LVL 4

Expert Comment

ID: 6335625
kaushal:

can you please give feedback for earlier posts?
0

Author Comment

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

LVL 4

Expert Comment

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

Author Comment

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

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

ID: 6355854
Kaushal:
Any update?
0

LVL 54

Expert Comment

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

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

Netminder
0

## Featured Post

Question has a verified solution.

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

Make the most of your online learning experience.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
###### Suggested Courses
Course of the Month12 days, 15 hours left to enroll

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

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