필터 지우기
필터 지우기

plotting two vectors on same graph

조회 수: 33 (최근 30일)
shyam
shyam 2013년 9월 2일
many suggested me to used hold but it didnot work in my case because the x-axis is not the same for two plots i just want to impose one plot on other just like as in Photoshop one layer on other
what i got is this but not desired for following code
%Read Original Wav File
[y,fs] = wavread('F:\USCAS\KnowlessMicSpeechfiles\starts_with_speech.wav');
dt = 1/fs;
t = 0:dt:(length(y)*dt)-dt;
figure;
plot(t,y,'g');
hold on;
%Plotting the VAD of energy basedfile
fvad=fopen('F:\USCAS\KnowlessMicSpeechfiles\starts_with_speech_ae_based_noised_th30.bin');
VAD=fread(fvad,'*uint8');
fclose(fvad);
t2=0:1:length(VAD)-1;
plot(t2,VAD,'r');%xlabel('Frames(VAD is supplied 100ms Frame sub frame size 10ms)');ylabel('Activity');
hold off;

채택된 답변

shyam
shyam 2013년 9월 2일
I have solved my problem by using Multiple x and y axis as shown here

추가 답변 (1개)

David Sanchez
David Sanchez 2013년 9월 2일
Scale the array with smallest range, like in this example:
Not scaled data:
x=1:500;
y=rand(500,1);
plot(x,y)
hold on
x2=0.1:.1:50;
y2=rand(500,1);
plot(x2,y2,'r')
hold off
Scaled data:
x=1:500;
y=rand(500,1);
plot(x,y)
hold on
x2=0.1:.1:50;
y2=rand(500,1);
plot(x2*10,y2,'r') % LOOK THE *10 in the plot calling
hold off

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by