MATLAB: How to solve exponential equation

equationsexponentialmath

Hi everybody
I have got a mat file that I need to use output for the function. Each row of the mat file will be implemented to the function ( 100 of them) and then each result will be saved as one matrix. The code I used did not help. Can anyone help me out?
load('example.mat');
X = sym( nan(size(ee)) );
for K = 1 : numel(ee)
solution = vpasolve( 0.4075*exp(-((x(K)-14.87)/11.39).^2) + 0.5621*exp(-((x(K)-18.64)/27.74).^2, x));
if isempty(solution)
fprintf('No solution for a(%d)\n', K);
else
X(K) = solution;
end
end
The variable ee is coming from the mat file that I loaded.
Thanks!!!

Best Answer

opt= optimoptions('fsolve','Display','none');
X0=15;
soln=arrayfun(@(e) fsolve(@(x) fnE(x)-e,X0,opt),ee);
NB: There are two possible solutions; which one fsolve finds will depend on whether the initial guess is on the LH or RH side of the maximum; the one above finds the RH set; setting X0=13 (say) returns the other.
You give no information as to which is the desired set or if it matters.