From f618466c25d43f3bae9e40920273bf77de1e1149 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Mon, 19 Oct 2020 23:09:30 -0400 Subject: initial sd-vbs initial sd-vbs add sd-vbs sd-vbs --- .../texture_synthesis/src/matlab/lplot.m | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 SD-VBS/benchmarks/texture_synthesis/src/matlab/lplot.m (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/lplot.m') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/lplot.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/lplot.m new file mode 100755 index 0000000..3c67d8b --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlab/lplot.m @@ -0,0 +1,43 @@ +% lplot(VEC, XRANGE) +% +% Plot VEC, a vector, in "lollipop" format. +% XRANGE (optional, default = [1,length(VEC)]), should be a 2-vector +% specifying the X positions (for labeling purposes) of the first and +% last sample of VEC. + +% Mark Liberman, Linguistics Dept, UPenn, 1994. + +function lplot(x,xrange) + +if (exist('xrange') ~= 1) + xrange = [1,length(x)]; +end + +msize = size(x); +if ( msize(2) == 1) + x = x'; +elseif (msize(1) ~= 1) + error('First arg must be a vector'); +end + +if (~isreal(x)) + fprintf(1,'Warning: Imaginary part of signal ignored\n'); + x = abs(x); +end + +N = length(x); +index = xrange(1) + (xrange(2)-xrange(1))*[0:(N-1)]/(N-1) +xinc = index(2)-index(1); + +xx = [zeros(1,N);x;zeros(1,N)]; +indexis = [index;index;index]; +xdiscrete = [0 xx(:)' 0]; +idiscrete = [index(1)-xinc indexis(:)' index(N)+xinc]; + +[mn,mx] = range2(xdiscrete); +ypad = (mx-mn)/12; % MAGIC NUMBER: graph padding + +plot(idiscrete, xdiscrete, index, x, 'o'); +axis([index(1)-xinc, index(N)+xinc, mn-ypad, mx+ypad]); + +return -- cgit v1.2.2