How to use Excel Solver function in matlab

I have three data values i assume to calculate estimated data as follows:
measureddata = [0,0,6.98505000000000e-05,0,8.56860000000000e-05,0.000232607000000000]; diameter = [0.00915990100000000,0.0109198380000000,0.0130150620000000,0.0155379660000000,0.0185486630000000,0.0221608790000000];
%assumed values mmd = 0.1; gsd = 2; mtotal = 100;
Mestimate(1,1) = logncdf(diameter(1,1),log(mmd),log(gsd))*mtotal; [m n] = size(diameter); for i=2:n Mestimate(1,i) = logncdf(diameter(1,i),log(mmd),log(gsd))*mtotal - logncdf(diameter(1,i-1),log(mmd),log(gsd))*mtotal; end
SSE = sum((measureddata - Mestimate).^2);
I have three data values i assume to calculate estimated data as follows:
measureddata = [0,0,6.98505000000000e-05,0,8.56860000000000e-05,0.000232607000000000];
diameter = [0.00915990100000000,0.0109198380000000,0.0130150620000000,0.0155379660000000,0.0185486630000000,0.0221608790000000];
%assumed values
mmd = 0.1;
gsd = 2;
mtotal = 100;
Mestimate(1,1) = logncdf(diameter(1,1),log(mmd),log(gsd))*mtotal;
[m n] = size(diameter);
for i=2:n
Mestimate(1,i) = logncdf(diameter(1,i),log(mmd),log(gsd))*mtotal - logncdf(diameter(1,i-1),log(mmd),log(gsd))*mtotal;
end
SSE = sum((measureddata - Mestimate).^2);
The estimated data 'Mestimate' is calculated based on assuming variables mmd,gsd, and mtotal. Then i calculate the Sum of Square Errors (SSE) using the measured data 'measureddata' and estimated data 'Mestimate'.
With excel i can use Solver and set my objective = SSE to 'Minimum' by changing variables mmd,gsd, and mtotal, and excel will five me new values for mmd,gsd, and mtotal.
How can i do this in Matlab?

Answers (0)

Tags

No tags entered yet.

Asked:

on 15 Jul 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!