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!

Importing data from xls file 1

Status
Not open for further replies.

rm2

Mechanical
Jun 7, 2005
41
0
0
MX
Hello

I am indexing information from a xls file, most of it by columns. How can I place conditions to the importing data?
i.e. Indexing data from Col1 that is greater than 0
Col 1
3
4
5
0
9

variablex= data :),1) IF >0 ?????????????

thanks for your help

 
Replies continue below

Recommended for you

This is how I would do it.

%this returns the indeces of all nonzero elements of A to elements of X.

X=find(A)

%this makes a new matrix (column vector) that is as long as X but with the elements in A, which have indeces given by the elements of X

B(1:size(X))=A(X)

%Just make a function that imports the variable, runs it through this program, and then spits it into the workspace or a .mat file or whatever.

Custodes
 
Status
Not open for further replies.
Back
Top