How do you evaluate a revenue function over a range of price and quanity inputs?
12 views (last 30 days)
Show older comments
Problem: I have generated a production function which yields a production quantity qm_30 (m x n matrix) for months 1:length(qm_30). I used the ndgrid Matlab function to evaluate my production function over a range of inputs, but can't figure out how to (if I can) use it to evaluate the formula below over a range of the variable price .
Question: How can I solve most efficiently for netcfq given a range of input values for the variable price ?
- qm_30 is a 487 x 11 (m x n) matrix
- all other variables are scalars
- price is currently a scalar ($4.00) but I would like to set it to be a range (say $3.00:0.50:$5.00)
- netcfq = (qm_30*nri*( price +pricediff))-(qm_30* price *prodtax)-(qm_30*opex_var)-((qm_30./qm_30)*opex_fix);
Thanks!
0 Comments
Answers (1)
dpb
on 9 Jul 2014
Edited: dpb
on 9 Jul 2014
Factoring out the common variable of qm30, it would seem your functional is--
netcfq = qm_30*(nri*(price+pricediff) - price*prodtax - opex_var) - opex_fix;
To evaluate over an array, simply convert to use the "dot" operators--
netcfq = qm_30.*(nri.*(price+pricediff) - price.*prodtax - opex_var) - opex_fix;
Should be all need unless I missed something. Generate the array w/ meshgrid per the example therein--
doc meshgrid
6 Comments
dpb
on 9 Jul 2014
Oh...my misunderstanding...think your best bet in this case is simply to write a loop, likely.
See Also
Categories
Find more on Creating and Concatenating Matrices 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!