Open in the MATLAB editor: m01nc_example
function m01nc_example fprintf('m01nc example results\n\n'); ch = {'black '; 'blue '; 'crimson'; 'cyan '; 'green '; 'orange '; 'pink '; 'purple '; 'red '; 'white '}; item = {'blond '; 'amber '; 'plum '; 'yellow '}; m1 = int64([ 1 1 1 5]); m2 = int64([ 7 10 10 10]); validate = true; for j = 1:4 [result, ifail] = m01nc( ... validate, ch, item{j}, 'm1', m1(j), 'm2', m2(j)); validate = false; fprintf('Search for %s in index range [%2d:%2d]: index = %2d\n', ... item{j}, m1(j), m2(j), result); end
m01nc example results Search for blond in index range [ 1: 7]: index = 1 Search for amber in index range [ 1:10]: index = 0 Search for plum in index range [ 1:10]: index = 7 Search for yellow in index range [ 5:10]: index = 10