I would calculate it from the solved values for ‘x’:
lamda = 10;
surface = x(:,2) + lamda*(x(:,1)-5);
Unless you are returning event variables, returning extra outputs from ode45 are, to my knowledge, not supported.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!