Solved

MATLAB-STRUCTURES

Posted on 2001-07-30
8
906 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
8 Comments
 
LVL 4

Expert Comment

by:prashant_n_mhatre
Comment Utility
kaushal:

can you please give feedback for earlier posts?
0
 

Author Comment

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

Expert Comment

by:prashant_n_mhatre
Comment Utility
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

by:kaushalshah
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 4

Expert Comment

by:prashant_n_mhatre
Comment Utility
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
Comment Utility
Kaushal:
Any update?
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility

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
Comment Utility
Per recommendation, points NOT refunded and question closed.

Netminder
EE Admin
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now