4
|
1 function [xx, yy] = meshdom (x, y) |
|
2 |
|
3 # usage: [xx, yy] = meshdom (x, y) |
|
4 # |
|
5 # Given vectors of x and y coordinates, return two matrices |
|
6 # corresponding to the x and y coordinates of the mesh. |
|
7 # |
|
8 # See the file sombrero.m for an example of using mesh and meshdom. |
|
9 # |
|
10 # See also: plot, semilogx, semilogy, loglog, polar, mesh, contour, |
|
11 # bar, stairs, gplot, gsplot, replot, xlabel, ylabel, title |
|
12 |
|
13 if (nargin == 2) |
|
14 if (is_vector (x) && is_vector (y)) |
|
15 xlen = length (x); |
|
16 ylen = length (y); |
|
17 xx = zeros (ylen, xlen); |
|
18 yy = zeros (ylen, xlen); |
|
19 y = y (ylen:-1:1); |
|
20 if (columns (x) == 1) |
|
21 x = x'; |
|
22 endif |
|
23 if (rows (y) == 1) |
|
24 y = y'; |
|
25 endif |
|
26 for i = 1:ylen |
|
27 xx(i,:) = x; |
|
28 endfor |
|
29 for i = 1:xlen |
|
30 yy(:,i) = y; |
|
31 endfor |
|
32 else |
|
33 error ("meshdom: arguments must be vectors"); |
|
34 endif |
|
35 else |
|
36 error ("usage: [xx, yy] = meshdom (x, y)"); |
|
37 endif |
|
38 |
|
39 endfunction |