Code covered by the BSD License  

Highlights from
Uncertainty Analysis of a DC Motor

image thumbnail

Uncertainty Analysis of a DC Motor

by

 

04 Dec 2006 (Updated )

Using Statistics for Uncertainty Analysis in System Models

plotByColorMap(time,velocity,colorVar)
function plotByColorMap(time,velocity,colorVar)
% TODO
%
if ndims(time) ~= ndims(velocity)
    error('Time and Velocity are not same size')
end

% Is there a current figure?
h = get(0,'CurrentFigure');
if isempty(h)
  h = figure;
end

% set colormap environment
colormap('autumn');
cmap = colormap;
[cmapVar, cax] = mcColorMap(colorVar,cmap);
figure(h), set(h,'Colormap',cmap), caxis(cax), colorbar, hold on

% add lines to plot
for i = 1:length(time)
   line(time{i},velocity{i},'color',cmapVar(i,:))
end

% add labels
xlabel('Time (s)')
ylabel('Angular Velocity (rpm)')

Contact us