function [a,x,y] = dspblkconstdiag(q)
% DSPBLKCONSTDIAG DSP Blockset Constant Diagonal Matrix block helper function.

% Copyright 1995-2000 The MathWorks, Inc.
% $Revision: 1.5 $ $Date: 2000/04/29 22:54:33 $

% q is the desired diagonal
q_elements = q(:);
a = diag(q_elements);

% For plotting
x = [0,NaN,100,NaN,[20 10 10 20],NaN,[84 96 96 84],NaN,[20 80]];
y = [0,NaN,100,NaN,[90 90 10 10],NaN,[90 90 10 10],NaN,[80 20]];

% Set frame-based behavior in underlying Frame Status Conversion block
enable_frame_blk = [gcb '/Frame Status Conversion'];
framebased       = strcmp(get_param(gcb,'frame'),'on');
currentFrameStr  = get_param(enable_frame_blk, 'outframe');

if framebased,
    % Only set to Frame-based if it isn't already set
    if ( strcmp(currentFrameStr, 'Frame-based') == 0 )
        set_param(enable_frame_blk, 'outframe', 'Frame-based');
    end
else
    % Only set to Sample-based if it isn't already set
    if ( strcmp(currentFrameStr, 'Sample-based') == 0 )
        set_param(enable_frame_blk, 'outframe', 'Sample-based');
    end
end

% [EOF] dspblkconstdiag.m
