matlab - GnuPlot : feed each column from different files -
i plot 3d graph fed 2 different data files. first 1 have z-data, stored in following way, columns have different sizes:
x00 z00 x10 z10 x20 z20... xn0 zn0 x01 z01 x11 z11 x21 z21 x02 z02 x12 z12 x22 z23 .... x0a z0a x1a z1a x2a z2a ... x1(a+1) z1(a+1) x2(a+1) z2(a+1) ... ... x1b z1b x2b z2b x1(b+1) z1(b+1) x2(b+1) z2(b+1) ... ... x1c z1c x1(c+1) z1(c+1)
the second file contain y data, in appropriate format:
y00 y10 y20 ...
i need equivalent following matlab code (where have separately read columns, , formed appropriate xz matrix data). note 'data' matrix, matrix of dimensions(2n x c) c max size of largest column. remaining non-exiting data (for shorter columns) filled 'nan' value. there way use pm3d achieve that?
ydata=[1,2,3,5,7,10]; figure; hold all; yindex=1:length(ydata) col = yindex*2; colsize=length(data(:,col)); plot3(ydata(yindex)*ones(colsize),data(:,col-1),data(:,col)); end xlabel('x'); ylabel('y'); zlabel('z'); grid on; hold off;
Comments
Post a Comment