0001
0002
0003 function hxp = xp_PlotData (xp, op)
0004
0005
0006 hxp = struct;
0007
0008 if nargin < 2
0009 op = struct;
0010 end
0011
0012 if isempty(op); op = struct; end;
0013
0014 op = struct_addDef(op,'args',{});
0015
0016 xlims = op.xlims;
0017 ylims = op.ylims;
0018
0019
0020
0021 xp = xp.squeezeRegexp('Dim');
0022
0023
0024 data = dsMdd2ds(xp);
0025
0026
0027 for i = 1:length(data)
0028 labels = data(i).labels;
0029 labels_sans_time = labels(~strcmp(labels,'time'));
0030
0031 for j = 1:length(labels_sans_time)
0032 d = data(i).(labels_sans_time{j});
0033 ind = all(~isnan(d),1);
0034 d=d(:,ind);
0035 data(i).(labels_sans_time{j}) = d;
0036 end
0037 end
0038
0039
0040
0041
0042
0043
0044
0045 if isfield(data(1),'varied')
0046 varied = data(1).varied;
0047 for i = 1:length(data);
0048 for j = 1:length(varied)
0049 if ischar(data(i).(varied{j}))
0050 temp = data(i).(varied{j});
0051 ind = strfind(temp,'_');
0052 temp = str2num(temp(1:ind-1));
0053 if isempty(temp); temp = 0; end
0054 data(i).(varied{j}) = temp;
0055 end
0056 end
0057 end
0058 end
0059 hxp.hcurr = dsPlot(data,op.args{:},'lock_gca',true);
0060
0061 if ~isempty(xlims); xlim(xlims); end
0062 if ~isempty(ylims); ylim(ylims); end
0063
0064 end
0065
0066