1 | function plot_qmumean(md,options,nlines,ncols,i);
|
---|
2 | %PLOT_QMUMEAN - plot mean of a scaled response
|
---|
3 | %
|
---|
4 | % Usage:
|
---|
5 | % plot_qmumean(md,options,nlines,ncols,i);
|
---|
6 | %
|
---|
7 | % See also: PLOTMODEL
|
---|
8 |
|
---|
9 | %plot mesh
|
---|
10 | subplot(nlines,ncols,i);
|
---|
11 |
|
---|
12 | %edgecolor
|
---|
13 | edgecolor=getfieldvalue(options,'edgecolor','none');
|
---|
14 |
|
---|
15 | %process data and model
|
---|
16 | [x y z elements is2d isplanet]=processmesh(md,[],options);
|
---|
17 |
|
---|
18 | %find response function
|
---|
19 | if exist(options,'qmudata'),
|
---|
20 | descriptor=getfieldvalue(options,'qmudata');
|
---|
21 | if ~ischar(descriptor),
|
---|
22 | error('plot_qmumean error message: descriptor should be a string');
|
---|
23 | end
|
---|
24 | else
|
---|
25 | error('plot_qmumean error message: provide descriptor of response function in ''qmudata'' option');
|
---|
26 | end
|
---|
27 |
|
---|
28 | %go pick up the response:
|
---|
29 | allresponses=md.qmu.results.dresp_out;
|
---|
30 | responses=zeros(md.qmu.numberofpartitions,1);
|
---|
31 |
|
---|
32 | count=1;
|
---|
33 | for i=1:length(allresponses),
|
---|
34 | d=allresponses(i).descriptor;
|
---|
35 | if strncmpi(d,'scaled_',7),
|
---|
36 | d=d(8:end);
|
---|
37 | if strncmpi(d,descriptor,length(descriptor)),
|
---|
38 | responses(count)=allresponses(i).mean;
|
---|
39 | count=count+1;
|
---|
40 | end
|
---|
41 | end
|
---|
42 | end
|
---|
43 |
|
---|
44 | %log?
|
---|
45 | if exist(options,'log'),
|
---|
46 | responses=log(responses)/log(getfieldvalue(options,'log'));
|
---|
47 | end
|
---|
48 |
|
---|
49 | %now, project onto vertices
|
---|
50 | responses_on_node=responses(md.qmu.partition+1);
|
---|
51 |
|
---|
52 | %plot
|
---|
53 | A=elements(:,1); B=elements(:,2); C=elements(:,3);
|
---|
54 | patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_node,'FaceColor','interp','EdgeColor',edgecolor);
|
---|
55 |
|
---|
56 | %apply options
|
---|
57 | options=addfielddefault(options,'title',['Mean distribution of ' descriptor]);
|
---|
58 | options=addfielddefault(options,'colorbar',0);
|
---|
59 | applyoptions(md,[],options);
|
---|