is it possible to use a lookup table for optimization?
5 views (last 30 days)
Show older comments
Ekin Ceyda Cetin
on 8 Jan 2017
Commented: Ekin Ceyda Cetin
on 10 Jan 2017
I am doing an optimization and need to include a look up table as constraint. A variable is another's lookup table value. Is there a way I can do that?
0 Comments
Accepted Answer
Walter Roberson
on 8 Jan 2017
Beyond what the others posted: the additional bit of information you need is https://www.mathworks.com/help/matlab/math/parameterizing-functions.html
More Answers (2)
Image Analyst
on 8 Jan 2017
Sure. If you have a finite set of input values but a ton of numbers to compute it on, then it makes sense to compute it just once for every possible input value and build a look up table. Then just apply the value from lookup table to every value. It will be much faster.
For example if you have some complicated formula
outputGrayLevel = SomeComplicatedFormula(inputGrayLevel);
and you need to apply that 20 million times for a 20 megapixel image, then it makes sense to just do it 256 times for every possible gray level (of an 8 but integer image) and then use
outputImage = intlut(inputImage, lut);
Using the built-in intlut() function will be much, much faster than computing that complicated formula 20 million times.
0 Comments
See Also
Categories
Find more on Symbolic Variables, Expressions, Functions, and Preferences 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!