Combinations with constraint

1 view (last 30 days)
Andy
Andy on 4 May 2011
Hi There,
I am a matlab newbie and I have a spectral reflectance data set that I need to work with. The data is arrange is columns with the wavelengths being the header (i.e from 400nm to 2400 nm). I want to have all possible two-pair combination for the formula (?1-?2)/(?1+?2) where ?1 is greater than ?2. ? represents the wavelengths or the column headers.
Hope someone out there will help me to solve this problem.
Any assistance will be greatly appreciated.
Andy

Accepted Answer

Sean de Wolski
Sean de Wolski on 4 May 2011
doc meshgrid
Then apply your constraints to blank out entries. Depending on what you're doing with them you may be able to skip the overhead of creating all of the combinations by using BSXFUN to set it up for you and applying the constraint internally.

More Answers (0)

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!