how to plot multiple waves on one surface
4 views (last 30 days)
I have an inclined surface and 20 different specified points(x,y,z) on it.for each station I have a set of (time, amplitude) data i.e. a wave. I need to plot each wave at each related point. so a surface with 20 waves on it.
I have no idea how to do it, subplot probably won't work because I need to plot on specified points.
David Wilson on 19 Apr 2019
Here is a mock up solution.
Code is: below. I've used part of your data, but I've made up some similar data (using a sinc function) for the other trends. I've also edited your data file and stripped the header comments.
%% plot mini plots
fname = 'str-10dep00.dat';
fid = fopen(fname);
A = fscanf(fid,'%f');
A = reshape(A, 8,length(A)/8)';
t = A(:,1);
Now I've made a grid plot, and plotted the trends in row order. You will read each from a different file of course.
%% generate some interesting data
%% Now try grid
y = 2*[0:4]; z = 2*[0:-1:-5];
[Y,Z] = meshgrid(y,z);
dum = sinc(t/10);
D = [A(:,2:end), dum.*randn(length(t),23)*0.1] % store in row order
plot(Y,Z,'bo','MarkerFaceColor',[0.4588 0.7333 0.9922]);
s = D(:,k);
i = mod(k-1,5)+1;
j = -floor((k-1)/5);
x = (2*i-2)+t/t(end);
y = 2*j+ s/range(s);
plot(x,y,'-','color',[0.3176 0.6157 0.6863])