עבור לתוכן

matlab help

Featured Replies

פורסם

I want to compute the fourier transform of a given vector in time using the fft command

this is how my code looks like right now


n1 = -25:-1;
n2 = 1:25;
x1 = [(2 * sin(0.125*pi*n1) ./ n1).^2 0.6165 (2 * sin(0.125*pi*n2) ./ n2).^2];

N = 1024;

X = abs(fft(x1,N));
X = fftshift(X);

F = [-N/2 : N/2 - 1] / N;

plot(F,X);
%axis([-2*pi 2*pi 0 5]);

questions are:

is there a less ugly way to define the value in n=0?

i want the resulting plot to streach from -2*pi to 2*pi. commenting the axis command, it only goes from -0.5 to 0.5, while uncommenting it just cuts the plot at +-0.5, and it doesnt look too realistic. anyway to fix it?]

פורסם

לא אין דרך יותר יפה לעשות את זה

בקשר לצירים אז נדמה לי שצריך לעשות

axis equal או AXIS MANUAL

כן זה ניראה יותר טוב(לא מתוח)

זה לא אמור להיות בפורום שפות תיכנות?

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים