Prev: SimBiology - Hill Kinetics
Next: Problem using eval
From: Nathan on 7 Apr 2010 17:05 On Apr 7, 1:50 pm, Cristina <tweetycartoo...(a)hotmail.com> wrote: > Hi, > > I want to use the ind=find() function with <= and =>, but the matrices I want to use don't have the same dimensions. I know it can't work unless they are the same. Is there a way to make more code so that it does work? For example by turning the matrices into scalars (I don't know if this is possible)? > > Basically what I want to do is take a set of numbers, i.e. [ 1 2 3] for example and match those numbers with thoe in this array, let's say [ 2 3 6 8 9 1]. > > This is my code: > > max=[set of numbers] > min=[set of numbers] > > emission_wl=[larger set of numbers] > > ind=find((min)<=emission_wl & emission_wl=>(max)) > > Your help would be greatly appreciated, I'm really stuck on this. > > Thank you, > > Cristina You want to just "match" them? (What do you mean by, "match", by the way?) Do you mean you want to see which elements are in both arrays? A = [ 1 2 3]; B = [2 3 6 8 9 1]; C = intersect(A,B); %%%%%%%%%%% C = 1 2 3 Your "example" doesn't seem to match what you are saying. Also, note that using "max" and "min" as variable names is bad practice, as it overwrites the "max" and "min" MATLAB functions. What do the matrices "max" and "min" consist of, and what is in the matrix "emission_wl"? -Nathan
From: Cristina on 7 Apr 2010 14:13 Hi again, Really what I wanted to do was find the index of the numbers that were found in both matrices. Emission_wl, min, and max are just arrays of numbers. So I was trying to use the ind=find function, but intersect is so much simpler. Thank you very much for your help!!! Cristina
|
Pages: 1 Prev: SimBiology - Hill Kinetics Next: Problem using eval |