How can I connect the points in the merged stem graph
3 ビュー (過去 30 日間)
古いコメントを表示
Below is part of my code.
Do_FFT is a self-defined function for doing FFT.
[P1,f_axis] = Do_FFT(file,fs,0);
stem(f_axis,P1,'g');
hold on;
[Pf,f_axisf] = Do_FFT(file,fs,1,0.5);
stem(f_axisf,Pf);
[Pf,f_axisf] = Do_FFT(file,fs,1,0.5);
stem(f_axisf,Pf,'r');
Just ignore title and legends of the image.
I'd like to know how to draw a line to connect all of the points. Thanks a lot.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191014/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191015/image.jpeg)
0 件のコメント
回答 (1 件)
KSSV
2018 年 6 月 5 日
Use hold on and plot data.
figure
X = linspace(0,2*pi,50)';
Y = cos(X) ;
stem(X,Y)
hold on
plot(X,Y,'r')
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!