plot ''markers'' in graph

1 次查看(过去 30 天)
Hi everybody,
I have a time vector and a data vector. Furthermore I have a vector with specific time points that indicated the start of a wave. I would like to plot them together to see if the start of the wave time is correct. At the moment I can't plot them together because of the fact that the vectors are not of the same length and furthermore plotting the specific time points wil give a line while I would like to have 'markers' or points. Can somebody help?

采纳的回答

Sulaymon Eshkabilov
If understood your question correctly, this is what you are trying to do:
t = 0:.1:3; % Time
Data = exp(2*cos(t)); % Data vector
rng(1) % For this demo reproducibility purposes
ts = rand(1); % Wave starts at a time point
dt = 0.05; % Wave collected at a time step
tend = 5*rand(1); % Wave data collection ends at this time
tpoints = ts:dt:tend; % Specific time points at which the wave data was collected
Wave = sin(2*tpoints); % Wave Data vector
plot(t, Data, 'r--', 'DisplayName', 'Data with time')
hold on
plot(tpoints, Wave, 'bo-.', 'DisplayName', 'Wave with specific time points')
legend('Show')
xlabel('Time, [s]')
ylabel('Data & Wave')
grid on

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by