Why is nothing is being plotted when I run this?

r = randn(1000, 1);
r_DCT = dct(r);
plot(r_DCT, 'o-')

3 Kommentare

Here it works:
r = randn(1000, 1);
r_DCT = dct(r);
plot(r_DCT, 'o-')
Liam
Liam am 28 Mär. 2025
Do you know why it doesnt plot on MATLAB itself?
Torsten
Torsten am 28 Mär. 2025
Bearbeitet: Torsten am 28 Mär. 2025
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".

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Karanjot
Karanjot am 9 Apr. 2025

0 Stimmen

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.

Kategorien

Mehr zu Graphics finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2024b

Tags

Gefragt:

am 28 Mär. 2025

Beantwortet:

am 9 Apr. 2025

Community Treasure Hunt

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

Start Hunting!

Translated by