1 function plot_data_surf(v, M, Info)
2 %
function plot_data_surf(z,M)
4 %FUnction plots a 3D surfaceplot of given Data.
6 % v : Vector of measurements
7 % M : Matrix of measurepoints
9 % v(i) must be result of measurement at measurepoints M(i,:)
11 %In case of more complex data M (e.g. more than two parameter dimensions),
12 %one can specify the plot in the cells "Info".
14 %Info{1} : Vector of size two, defining the rows of to be used as
15 % %plotting dimensions
16 %Info{2} : Vector giving the values
for the dimensions which are not
18 % dim(Info{2}) = dim(M(1,:))
20 % Markus Dihlmann 04.02.2010
35 for j=1:length(M(1,:))
36 if(isempty(find(Info{1}==j)))
38 while(i<=length(M(:,1)))
39 if(M(i,j)~=Info{2}(j))
42 M=M(i+1:length(M(:,1)),:);
44 elseif(i>=length(M(:,1)))
48 M=[M(1:i-1,:);M(i+1:length(M(:,1)),:)];
49 v=[v(1:i-1);v(i+1:length(v))];
59 M(:,1)=Mbuf(:,Info{1}(1));
60 M(:,2)=Mbuf(:,Info{1}(2));
67 %Sort data of M into axis x and y:
86 elseif(x(ind+1)==x(ind))
93 x=x(1:length(x)-1); %cut last element
106 elseif(y(ind+1)==y(ind))
113 y=y(1:length(y)-1); %cut last element
115 %Sort Values of v in right position on z-Matrix
116 Z=zeros(length(x),length(y));
118 %search x-Value position
119 ind1=search_pos(M(i,1),x);
120 ind2=search_pos(M(i,2),y);
124 %Check consistency of given Data and Matrix Z
125 elem = length(Z(:,1))*length(Z(1,:));
127 disp('Warning: Plot may be not correct due to incomplete given data
');
138 function vec=cut_vec(vec,i)
139 %what type of vector?
140 if(length(vec(1,:))>1)
141 vec_type=0; %Column vector
143 vec_type=1; %Row vector
146 vec_buf = vec(i+1:length(vec));
158 function ind=search_pos(value,vec)
161 while ((~found)&&(ind<=length(vec)))
171 error('Error in plotting. Couldnot find index position');