% Regression test function (black blox) for FreeMat v3.6
% This function is autogenerated by helpgen.
function bbtest_success = bbtest_colormap
  bbtest_success = 1;
NumErrors = 0;
try
  x = linspace(-1,1,512)'*ones(1,512);

catch
  NumErrors = NumErrors + 1;
end
try
  y = x';

catch
  NumErrors = NumErrors + 1;
end
try
  Z = exp(-(x.^2+y.^2)/0.3);

catch
  NumErrors = NumErrors + 1;
end
try
  image(Z);

catch
  NumErrors = NumErrors + 1;
end
try
  mprint('colormap1');

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  colormap(copper);

catch
  NumErrors = NumErrors + 1;
end
try
  image(Z);

catch
  NumErrors = NumErrors + 1;
end
try
  mprint('colormap2');

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  a = copper;

catch
  NumErrors = NumErrors + 1;
end
try
  plot(a);

catch
  NumErrors = NumErrors + 1;
end
try
  mprint('colormap3');

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  t = linspace(0,1,256);

catch
  NumErrors = NumErrors + 1;
end
try
  A = [exp(-(t-1.0).^2/0.1);exp(-(t-0.5).^2/0.1);exp(-t.^2/0.1)]';

catch
  NumErrors = NumErrors + 1;
end
try
  plot(A);

catch
  NumErrors = NumErrors + 1;
end
try
  mprint('colormap4');

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  image(Z);

catch
  NumErrors = NumErrors + 1;
end
try
  colormap(A);

catch
  NumErrors = NumErrors + 1;
end
try
  mprint('colormap5');

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  w = sqrt(sum(A'.^2));

catch
  NumErrors = NumErrors + 1;
end
try
  sA = diag(1./w)*A;

catch
  NumErrors = NumErrors + 1;
end
try
  plot(A);

catch
  NumErrors = NumErrors + 1;
end
try
  mprint('colormap6');

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  image(Z);

catch
  NumErrors = NumErrors + 1;
end
try
  colormap(A);

catch
  NumErrors = NumErrors + 1;
end
try
  mprint('colormap7');

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
