Rev | Line | |
---|
[3291] | 1 | function expbox(filename)
|
---|
[13010] | 2 | %EXPBOX - Create an ARGUS file using two clicks
|
---|
[3291] | 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 |
|
---|
[6661] | 23 | x1=x(1);
|
---|
| 24 | x2=x(2);
|
---|
| 25 | x3=x2;
|
---|
| 26 | x4=x1;
|
---|
[3292] | 27 |
|
---|
[6661] | 28 | y1=y(1);
|
---|
| 29 | y2=y1;
|
---|
| 30 | y3=y(2);
|
---|
| 31 | y4=y3;
|
---|
[3292] | 32 |
|
---|
[3291] | 33 | %Build Exp structure
|
---|
| 34 | A=struct();
|
---|
| 35 | A.nods=5;
|
---|
| 36 | A.density=1;
|
---|
[3292] | 37 | A.x=[x1 x2 x3 x4 x1]';
|
---|
| 38 | A.y=[y1 y2 y3 y4 y1]';
|
---|
[3291] | 39 |
|
---|
| 40 | %Write structure
|
---|
| 41 | expwrite(A,filename);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.