Why is nothing is being plotted when I run this?

조회 수: 3 (최근 30일)
Liam
Liam 2025년 3월 28일
답변: Karanjot 2025년 4월 9일
r = randn(1000, 1);
r_DCT = dct(r);
plot(r_DCT, 'o-')
  댓글 수: 3
Liam
Liam 2025년 3월 28일
Do you know why it doesnt plot on MATLAB itself?
Torsten
Torsten 2025년 3월 28일
편집: Torsten 2025년 3월 28일
Do you know why it doesnt plot on MATLAB itself?
I can't see how MATLAB is configured on your computer. Don't you get an error message ? Maybe you don't have the Signal Processing Toolbox licenced and/or installed which is necessary for using "dct".

댓글을 달려면 로그인하십시오.

답변 (1개)

Karanjot
Karanjot 2025년 4월 9일
Hi Liam,
This is the default behaviour for MATLAB scripts or '.m' files. If you want the figure to show up in line with the code, you can consider using a MATLAB live script instead.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by