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?
This is the Code Im using, im not sure what the sizes are. I tried to use the 'origin' function and the limits but it still didnt work. If you could look at it it would be great thank you.
fs =48000; %sampling frequency
Ts= 1/fs; %sampling duration
symbolrate = 1000; %transmitted pulses/second should be an integer divisor of fs
symbol_length = fs/symbolrate; %number of samples in one symbol
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:
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
3 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/590848-plotting-frequency-with-different-vector-error#comment_1001869
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/590848-plotting-frequency-with-different-vector-error#comment_1001869
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/590848-plotting-frequency-with-different-vector-error#comment_1001950
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/590848-plotting-frequency-with-different-vector-error#comment_1001950
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/590848-plotting-frequency-with-different-vector-error#comment_1002118
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/590848-plotting-frequency-with-different-vector-error#comment_1002118
Sign in to comment.