Plotting frequency with different vector error
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to plot a frequency graph with the center at the origin but I keep getting the error that the two vectors are different lengths. Is there anyway to fix this?
3 Commenti
Walter Roberson
il 9 Set 2020
What input are you using? When I tried in R2020a on Mac and used 'hello' as the ASCII input, I had no problem.
Risposte (1)
Amrtanshu Raj
il 11 Set 2020
Hi,
To get the desired shift so that the graph is symmetric about the origin, you can make the following changes in your code where you plot the ‘freq’ variable:
sz = length(freq)/2;
k = [-sz:-1,1:sz];
plot(k,abs(freq));
0 Commenti
Vedere anche
Categorie
Scopri di più su Graph and Network Algorithms in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!