how to plot multiple waves on one surface
Show older comments
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.
please help!
12 Comments
KSSV
on 15 Apr 2019
use hold on and plot.
Samaneh Arzpeima
on 17 Apr 2019
Walter Roberson
on 17 Apr 2019
"for each station"
Would that be 20 stations, one for each of different specified points?
"I have a set of (time,amplitude) data"
How are those data arranged? Do you have 20 different time variables and 20 different amplitude variables? Do you have a struct array? Do you have 20 x 2 cell array?
Samaneh Arzpeima
on 17 Apr 2019
Samaneh Arzpeima
on 17 Apr 2019
Etsuo Maeda
on 17 Apr 2019
You mean 3D scatter plot and labels...?

Walter Roberson
on 18 Apr 2019
Edited: Walter Roberson
on 18 Apr 2019
I think it means
plot3(station_x + time, station_y + amplitude, station_z * ones(size(station_x)))
where the bit with ones() is replication the constant station_z for each of the time, amplitude pairs for the station.
On the other hand, with the way the problem has been explained, it would instead be valid to suspect that the user wants a 5 dimensional plot, with the 5 axes being x, y, z, time, and amplitude.
Etsuo Maeda
on 18 Apr 2019
5 axes! xyz positoins in each frame, color as amplitude, frame as time...

Walter Roberson
on 18 Apr 2019
Edited: Walter Roberson
on 18 Apr 2019
Yes, but the x, y, z would not vary for any given point, so the datasets would be encoded as changes in color of each point over time. It might be meaningful for someone...
I must say that humans are typically not very good at judging relative time durations by waiting through them, or at accurately judging times less than 1 second duration. Or, for that matter, judging precisely what change in value is intended by changing color from (say) burnt umber to (say) sea foam green.
Samaneh Arzpeima
on 19 Apr 2019
Edited: Samaneh Arzpeima
on 19 Apr 2019
Samaneh Arzpeima
on 19 Apr 2019
Samaneh Arzpeima
on 19 Apr 2019
Answers (1)
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');
fclose(fid);
A = reshape(A, 8,length(A)/8)';
t = A(:,1);
plot(t,A(:,3),'.-');
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]);
axis(2*[-1,5,-6,1]);
xlabel('x'); ylabel('z')
hold on
for k=1:size(D,2)
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])
end
hold off
2 Comments
Samaneh Arzpeima
on 19 Apr 2019
Samaneh Arzpeima
on 19 Apr 2019
Edited: Samaneh Arzpeima
on 19 Apr 2019
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!