source: issm/trunk-jpl/src/m/exp/expbox.m@ 13010

Last change on this file since 13010 was 13010, checked in by Mathieu Morlighem, 13 years ago

CHG: moving stuff around

File size: 799 bytes
RevLine 
[3291]1function 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
11if 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
17end
18
19%Get points
20disp('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]23x1=x(1);
24x2=x(2);
25x3=x2;
26x4=x1;
[3292]27
[6661]28y1=y(1);
29y2=y1;
30y3=y(2);
31y4=y3;
[3292]32
[3291]33%Build Exp structure
34A=struct();
35A.nods=5;
36A.density=1;
[3292]37A.x=[x1 x2 x3 x4 x1]';
38A.y=[y1 y2 y3 y4 y1]';
[3291]39
40%Write structure
41expwrite(A,filename);
Note: See TracBrowser for help on using the repository browser.