Skip to content

Commit bd5d5bb

Browse files
committed
Forgotten function for test
1 parent 522f43b commit bd5d5bb

File tree

2 files changed

+34
-278
lines changed

2 files changed

+34
-278
lines changed

PQSQRegression.asv

Lines changed: 0 additions & 278 deletions
This file was deleted.

tests/drawPlot.m

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
function drawPlot( B, lims, spec )
2+
%drawPlot draw line y=b(1)+x*B(2) in axis with limits 'lims' by line
3+
%specification 'spec'.
4+
5+
% Calculate value of Y i n the two borders of x interval
6+
x1 = lims(1);
7+
x2 = lims(2);
8+
y1 = B(1) + x1 * B(2);
9+
y2 = B(1) + x2 * B(2);
10+
if y1 > y2
11+
% Decreasing line
12+
if y1 > lims(4)
13+
y1 = lims(4);
14+
x1 = (y1 - B(1)) / B(2);
15+
end
16+
if y2 < lims(3)
17+
y2 = lims(3);
18+
x2 = (y2 - B(1)) / B(2);
19+
end
20+
else
21+
% Increasing line
22+
if y2 > lims(4)
23+
y2 = lims(4);
24+
x2 = (y2 - B(1)) / B(2);
25+
end
26+
if y1 < lims(3)
27+
y1 = lims(3);
28+
x1 = (y1 - B(1)) / B(2);
29+
end
30+
end
31+
% Draw line
32+
plot([x1, x2], [y1, y2], spec);
33+
end
34+

0 commit comments

Comments
 (0)