-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflwcs.m
More file actions
31 lines (23 loc) · 779 Bytes
/
flwcs.m
File metadata and controls
31 lines (23 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function TheLine = flwcs( chars , L )
% Mnemonic : Fill Line With CharacterS
%
% This functions returns a string of length (L) with a periodic repetion of
% the chars supplied. Default inputs: chars= '|-<>-|', L=CommandWindow
% This function fills the length of the current command window with a
% periodic repetition of the string characters given in chars.
%
% Alexandros Pitilakis,
% Thessaloniki, December 2009
if nargin == 0
clc; chars = '|-<>-| ';
end
if nargin <= 1
L = get(0,'CommandWindowSize')-2;
end
dL = length(chars);
N = ceil( L(1)/dL );
TheLine = repmat( chars , 1 , N );
TheLine = TheLine(1:L-1); %Crop a little from the end, cuz sometimes it leaks
if nargout == 0 && nargin == 0
disp( TheLine(1:L-1) );
end