Please help me convert equation to matlab code.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Deal all.
I need you to help turn this equation into matlab code
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/338641/image.jpeg)
I spent a lot of time making it but it didn't work. thanks.
2 Commenti
Sriram Tadavarty
il 29 Lug 2020
Hi Ian,
Can you post the code that you tried and what the issue was or what didn't work? From that equation it is not straight forward as what the values of each variable be.
Regards,
Sriram
Risposte (1)
Alan Stevens
il 2 Ago 2020
This does what you seemed to be trying to do::
pgridbuy = [3.3, 3.5, 3.2, 3.1, 3.6];
pgridsold = [2.3, 2.6, 3.1, 4.1, 4.4];
pricebuy = [2400, 2400, 2400, 2400, 2400];
pricesell = [1300, 1300, 1300, 1300, 1300];
deltaT = 1;
TC = sum(pgridbuy.*pricebuy - pgridsold.*pricesell )/deltaT;
disp(TC)
I assume that, in general, you will not want all the values of pricebuy and pricesell to be the same.
0 Commenti
Vedere anche
Categorie
Scopri di più su Instrument Control Toolbox Supported Hardware in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!