Mercurial > repos > public > sbplib
changeset 363:8c8fd649bae3
Merge default heads.
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Tue, 20 Dec 2016 15:36:29 +0100 |
parents | ded4156e53e2 (current diff) 5cb99f56f55e (diff) |
children | f908ce064f35 |
files | |
diffstat | 4 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
diff -r ded4156e53e2 -r 8c8fd649bae3 +grid/place_label.m --- a/+grid/place_label.m Tue Dec 20 15:04:02 2016 +0100 +++ b/+grid/place_label.m Tue Dec 20 15:36:29 2016 +0100 @@ -1,3 +1,5 @@ +% 'left' | 'center' | 'right' +% 'baseline' | 'top' | 'cap' | 'middle' | 'bottom' function place_label(pt,str,horzAl,vertAl) default_arg('horzAl','center'); default_arg('vertAl', 'middle');
diff -r ded4156e53e2 -r 8c8fd649bae3 spyh.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spyh.m Tue Dec 20 15:36:29 2016 +0100 @@ -0,0 +1,16 @@ +% spyh mimics the built in spy but returns a handle which allows modifying the plot. +function h = spyh(A) + [n,m] = size(A); + [I,J] = find(A); + + h = plot(J,I); + h.LineStyle = 'none'; + h.Marker = '.'; + h.MarkerSize = 14; + + a = gca; + xlim([0 m+1]); + ylim([0 n+1]); + axis square + a.YDir = 'reverse'; +end \ No newline at end of file
diff -r ded4156e53e2 -r 8c8fd649bae3 stripeMatrix.m --- a/stripeMatrix.m Tue Dec 20 15:04:02 2016 +0100 +++ b/stripeMatrix.m Tue Dec 20 15:36:29 2016 +0100 @@ -1,4 +1,5 @@ % Creates a matrix of size n,m with the values of val on the diagonals diag. +% A = stripeMatrix(val,diags,n,m) function A = stripeMatrix(val,diags,n,m) default_arg('m',n);
diff -r ded4156e53e2 -r 8c8fd649bae3 timeTask.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/timeTask.m Tue Dec 20 15:36:29 2016 +0100 @@ -0,0 +1,9 @@ +function done = timeTask(taskName) + fprintf('%s', taskName); + tStart = tic; + + function done_fun() + fprintf(' - done %fs\n', toc(tStart)); + end + done = @done_fun; +end \ No newline at end of file