Sum of a function
显示 更早的评论
Hello everyone, I am stucked on how to write particular code for a Nash-Cournout oligopolistic equilibrium problem. I have written everything correctly and it ran successfully. The only situation I am in presently is trying to vary a particular step. To be more precise
I need code for the following:
is random for every 
is random for every
and
is random for every
. I need to execute the following Quad program $c_j(x_j) = \frac{1}{2}x{_j}^{'} P_j x_j+ {q_j}^{'} x{_j}$. I will be glad if I can get a prompt help on this.https://www.mathworks.com/matlabcentral/answers/uploaded_files/226241/Screenshot_20190625-093751.png
Thanks
采纳的回答
更多回答(1 个)
Olawale Kazeem
2019-6-25
0 个投票
10 个评论
Himanshu Rai
2019-6-25
I have updated my answer based on the image file you provided. Update your question, attach this file in the question and also don't comment as answer
Olawale Kazeem
2019-6-25
Olawale Kazeem
2019-6-25
Himanshu Rai
2019-6-25
Use
sum(c) % here c is what you get from the expression in the answer
Olawale Kazeem
2019-6-25
Himanshu Rai
2019-6-25
This doesn't make any sense - how can we add 20 elements, if there are only 10 elements in vector.
Olawale Kazeem
2019-6-25
Himanshu Rai
2019-6-25
Olawale Kazeem
2019-6-25
Himanshu Rai
2019-6-25
This is not x, but
.
is a vector but x is a matrix. And what you denote by c above is actually 
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




