source: issm/trunk/src/m/exp/operation/addprofile.m@ 26744

Last change on this file since 26744 was 24313, checked in by Mathieu Morlighem, 5 years ago

merged trunk-jpl and trunk for revision 24310

File size: 1.3 KB
RevLine 
[13730]1function [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
[1]2%ADDPROFILE - add a profile
3%
[8662]4% this script is used by exptool as an elementary operation
[1]5% on an ARGUS profile
6%
7% Usage:
[3018]8% [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root,options)
[13646]9
[1]10 title('click to add a point to the new profile, RETURN to exit','FontSize',14)
11 hold on
12
13 loop=1;
14 x=[];
15 y=[];
16
17 while loop
18
[24313]19 [xi,yi] = exp_ginput(1,options);
[13646]20
[1]21 if ~isempty(xi)
22 x(end+1,1)=xi;
23 y(end+1,1)=yi;
24
25 %plot everything
26 undoplots(prevplot);
[5088]27 plot(x,y,'color',getfieldvalue(options,'color'),'LineStyle',getfieldvalue(options,'LineStyle'),'LineWidth',getfieldvalue(options,'LineWidth'),...
28 'MarkerEdgeColor',getfieldvalue(options,'MarkerEdgeColor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
29 plot(x(end),y(end),'MarkerEdgeColor',getfieldvalue(options,'selectioncolor'),'MarkerSize',getfieldvalue(options,'MarkerSize'),'Marker',getfieldvalue(options,'Marker'));
[1]30
31 else
32
33 %check that the profile is not empty
34 if ~isempty(x)
35 A(end+1).x=x;
36 A(end).y=y;
37 A(end).name=root;
38 A(end).density=1;
39 numprofiles=numprofiles+1;
40 numpoints=numpoints+length(x);
41 closed(end+1)=0;
42 end
43
44 %get out
45 loop=0;
46 end
47 end
48end
Note: See TracBrowser for help on using the repository browser.