Why is nothing is being plotted when I run this?

4 vues (au cours des 30 derniers jours)
Liam
Liam le 28 Mar 2025
r = randn(1000, 1);
r_DCT = dct(r);
plot(r_DCT, 'o-')
  3 commentaires
Liam
Liam le 28 Mar 2025
Do you know why it doesnt plot on MATLAB itself?
Torsten
Torsten le 28 Mar 2025
Modifié(e) : Torsten le 28 Mar 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".

Connectez-vous pour commenter.

Réponses (1)

Karanjot
Karanjot le 9 Avr 2025
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.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by