function plotdata(datamx,datainfo,xcol)
% =============================================================================
% PLOT DATA STORED IN MATRIX VARIABLE datamx
% function plotdata(datamx,datainfo,xcol)
% =============================================================================
% datamx  ... matrix variable containing columnwise data to plot
% datainfo... optional text matrix:
%             its first line will be put as graph title and its second line
%             as xlabel
% xcol    ... column index in 'datamx' indicating the x-axis data, then
%             the remaining columns are y-axis data
%             (optional: default=[]=all columns are y-axis data)

% (C) 1996, V. Vesely, Masaryk University of Brno (Czech Republic)
%
error(nargchk(1,3,nargin));
if nargin<3, xcol=[]; end
figure;
if isempty(xcol)
   plot(datamx);
else
   plot(datamx(:,xcol),datamx(:,xcol~=(1:size(datamx,2))));
   ax = axis;
   ax(1) = min(datamx(:,xcol)); ax(2) = max(datamx(:,xcol));
   axis(ax);
end
ax=axis;
if nargin==1, datainfo=[]; end
infosz = size(datainfo,1);
if infosz>=1
   title(deblank(datainfo(1,:)));
end
if infosz>=2
   xlabel(deblank(datainfo(2,:)));
end
