-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnarysuj_greena.m
49 lines (30 loc) · 959 Bytes
/
narysuj_greena.m
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
L = [0.0,10.0];
N = 101;
u = 1;
n = 0;
fun = @(r1,r2) nowa_calka( n, r1, r2, u);
function y = ferr (s, x), y = NaN; endfunction
rs = linspace(L(1),L(2),N);
r1 = repmat( rs', 1, N );
r2 = repmat( rs, N, 1 );
tic;
[y] = arrayfun(fun, r1, r2,"ErrorHandler",@ferr);
toc;
imagesc( rs, rs, abs(y) );
minimax = [min(min(abs(y))),max(max(abs(y)))];
title( sprintf("funkcja greena (abs) u=%f, n=%d\nmin=%f,max=%f",u,n,minimax(1),minimax(2)));
xlabel("x1");
ylabel("x2");
saveas(1,"green_abs.png");
imagesc( rs, rs, real(y) );
minimax = [min(min(real(y))),max(max(real(y)))];
title( sprintf("funkcja greena (Re) u=%f, n=%d\nmin=%f,max=%f",u,n,minimax(1),minimax(2)));
xlabel("x1");
ylabel("x2");
saveas(1,"green_real.png");
imagesc( rs, rs, imag(y) );
minimax = [min(min(imag(y))),max(max(imag(y)))];
title( sprintf("funkcja greena (Im) u=%f, n=%d\nmin=%f,max=%f",u,n,minimax(1),minimax(2)));
xlabel("x1");
ylabel("x2");
saveas(1,"green_imag.png");