Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regarding code.

Status
Not open for further replies.

vinsen

Mechanical
Feb 15, 2007
19
0
0
Hi,

i am a mechanical engineer with basic in matlab, i am having an array of data for compressor speed and efficiency.

but i would like to filter for speed of 5000 in that array,and also get the efficiencies which are in different arrays for that corresponding speed values.

can anyone suggest me how to get them and also i want them to be placed in a array element box of a new variable which i would create.

hope i could get some infos from you,

with kind regards,

vinod.b

 
Replies continue below

Recommended for you

You can use the find fuction to return the index of the element that matches your search criteria.

i.e.
a = [1 3 4 5 6]

a =

1 3 4 5 6

>> find(a>4)

ans =

4 5

>> find(a==4)

ans =

3

>> b = a(find(a==4))

b =

4


If your other arrays are the same length then you can use the same index to strip values from the other arrays.
 
thank you for your nice reply,

i could able to strip off few value from one array that is comp speed.
for example if i want to take values from comp speed from 4000 to 4500 rpm,
i would also like to take the corresponding values of this comp speed in another array in another variable called mas flow. then i would like to put both the filtered comp speed and mass flow for speed 4000 to 4500 in two cells with a new variable named as filtered comp speed.

how to do that ?

waiting for your reply,

thanks,

 
Status
Not open for further replies.
Back
Top