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
Solved

MATLAB-STRUCTURES

Posted on 2001-07-30
8
908 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
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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 …

856 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