Last change
on this file since 12997 was 6661, checked in by Eric.Larour, 14 years ago |
Added expsquare routine.
Modified expbox to create a box instead of a square.
|
File size:
797 bytes
|
Line | |
---|
1 | function expbox(filename)
|
---|
2 | %EXPBOX - Create a ARGUS file using to clicks
|
---|
3 | %
|
---|
4 | % Two clicks on a plot are used to generate a rectangular box
|
---|
5 | % This box is written in EXP format on filename
|
---|
6 | %
|
---|
7 | % Usage:
|
---|
8 | % expbox(filename)
|
---|
9 |
|
---|
10 | %check
|
---|
11 | if exist(filename,'file'),
|
---|
12 | choice=input(['A file ' filename ' already exists, do you want to modify it? (y/n)'],'s');
|
---|
13 | if ~strcmpi(choice,'y'),
|
---|
14 | disp('no modification done ... exiting');
|
---|
15 | return
|
---|
16 | end
|
---|
17 | end
|
---|
18 |
|
---|
19 | %Get points
|
---|
20 | disp('Click twice to define a rectangular domain. First click for upper left corner, second for lower right corner');
|
---|
21 | [x,y]=ginput(2);
|
---|
22 |
|
---|
23 | x1=x(1);
|
---|
24 | x2=x(2);
|
---|
25 | x3=x2;
|
---|
26 | x4=x1;
|
---|
27 |
|
---|
28 | y1=y(1);
|
---|
29 | y2=y1;
|
---|
30 | y3=y(2);
|
---|
31 | y4=y3;
|
---|
32 |
|
---|
33 | %Build Exp structure
|
---|
34 | A=struct();
|
---|
35 | A.nods=5;
|
---|
36 | A.density=1;
|
---|
37 | A.x=[x1 x2 x3 x4 x1]';
|
---|
38 | A.y=[y1 y2 y3 y4 y1]';
|
---|
39 |
|
---|
40 | %Write structure
|
---|
41 | expwrite(A,filename);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.