How do you evaluate a revenue function over a range of price and quanity inputs?
Afficher commentaires plus anciens
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!
Réponses (1)
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 commentaires
txvmi07
le 9 Juil 2014
txvmi07
le 9 Juil 2014
dpb
le 9 Juil 2014
I was presuming qm_30 was generated by meshgrid(x,y) where the x and y are the two variables over which the evaluation was wanted. To add a 3rd dimension, the extension would be meshgrid(x,y,z) where z is the price level vector.
If that's not the correct assumption, we'll have to dig deeper...
txvmi07
le 9 Juil 2014
dpb
le 9 Juil 2014
Oh...my misunderstanding...think your best bet in this case is simply to write a loop, likely.
Catégories
En savoir plus sur Naming Conventions dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!