Code covered by the BSD License  

Highlights from
OpenOpt

image thumbnail

OpenOpt

by

 

25 Nov 2006 (Updated )

nonSmoothSolve (similar to fsolve), non-smooth & noisy local + some global solvers; works in Octave

strtrim2(str)
function r = strtrim2(str)
r = str;

% if r(end) == ' '
%     ind = find(r ~= ' ', 1, 'last');
%this form of 'find' doesn't works in Octave
% r(ind+1:end)=[];
% end

% if r(1) == ' '
%     ind = find(r ~= ' ', 1, 'first');
%this form of 'find' doesn't works in Octave    
    
%     r(1:ind-1)=[];
% end

while r(end) == ' '; r(end) = []; end
while r(1) == ' '; r(1) = []; end

Contact us