axis X and Y code

Hi, how to take value from X axis on Waveform 1 and take value from Y axis of waveform 2 to plot in one waveform? the code?

回答 (1 件)

Image Analyst
Image Analyst 2016 年 10 月 16 日
編集済み: Image Analyst 2016 年 10 月 16 日

0 投票

Exactly what is Waveform 1 and waveform 2? If you plotted them in an axes, you know the x and y signals. For example
subplot(2, 2, 1);
plot(x1, y1);
subplot(2, 2, 2);
plot(x2, y2);
subplot(2, 2, 3);
plot(x1, y2); % Plot y2 using axis of x1.
Or maybe you want to use interp1() to sample y2 at the locations of elements of x1?

5 件のコメント

farah
farah 2016 年 10 月 16 日
Hi, if my variable name is waveform1 then how to take only the data value from X axis?
plot(waveform1);? I want only the data from X axis to be insert in new waveform.
Actually, there are the two different waveform which I need data value of X axis from waveform1 and Y axis from waveform2.
Image Analyst
Image Analyst 2016 年 10 月 16 日
How did you plot it? If you don't explicitly pass in an x and a y, it will assume the argument is y and the x axis is the index number of the y array.
If you passed only waveform1 into plot(), then the "x" will be 1:length(waveform1).
Same for waveform2.
farah
farah 2016 年 10 月 16 日
The data is obtain from workspace for waveform1 of time scale and another one is obtain from decompose wavelet of array. is it possible to do that?
Image Analyst
Image Analyst 2016 年 10 月 16 日
I didn't understand that. Are you saying that you have another array, say x1, that says what the x value of each element of waveform1 is?
farah
farah 2016 年 10 月 16 日
No No. For waveform1 obtain from workspace (Amplitude=Y-axis) and (Time=X-axis). For waveform2 obtain from decompose wavelet (Detail Coefficient=Y-axis) and (Array sample=X-axis))
Now I want to plot new waveform3 which contains (detail coefficient= Y-axis and Time=X-axis)

サインインしてコメントする。

タグ

質問済み:

2016 年 10 月 16 日

コメント済み:

2016 年 10 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by