I have the following problem:
I was able to do part (a), but got stuck when I got to part (b).
So far, my code is:
Then for part (b), I tried:
but I received an error that said:
??? Undefined function or method 'fourier' for input
arguments of type 'double'.
Is there another way to do this? I tried googling other methods but I can't find any, so if anyone could please help, I greatly appreciate it.
I was able to do part (a), but got stuck when I got to part (b).
So far, my code is:
Rich (BB code):
n=7; star=-2*n:2*n;
bbox=(abs(star)<=n); bbox=bbox/sqrt(sum(bbox.^2));
cox=cos(pi*star/(2*n+1)).*bbox; cox=cox/sqrt(sum(cox.^2));
c2ox=cos(pi*star/(2*n+1)).*cox; c2ox=c2ox/sqrt(sum(c2ox.^2));
% Plots for n=7
subplot(331),plot(star,bbox),xlabel('*'),ylabel('bbox(*)'),title('bbox(*) for n=7')
subplot(332),plot(star,cox),xlabel('*'),ylabel('cox(*)'),title('cox(*) for n=7')
subplot(333),plot(star,cox),xlabel('*'),ylabel('cox(*)'),title('cox(*) for n=7')
% Decrease n by 1
n=6; star=-2*n:2*n;
bbox=(abs(star)<=n); bbox=bbox/sqrt(sum(bbox.^2));
cox=cos(pi*star/(2*n+1)).*bbox; cox=cox/sqrt(sum(cox.^2));
c2ox=cos(pi*star/(2*n+1)).*cox; c2ox=c2ox/sqrt(sum(c2ox.^2));
% Plots for n=6
subplot(334),plot(star,bbox),xlabel('*'),ylabel('bbox(*)'),title('bbox(*) for n=6')
subplot(335),plot(star,cox),xlabel('*'),ylabel('cox(*)'),title('cox(*) for n=6')
subplot(336),plot(star,cox),xlabel('*'),ylabel('cox(*)'),title('cox(*) for n=6')
% Increase n by 1
n=8; star=-2*n:2*n;
bbox=(abs(star)<=n); bbox=bbox/sqrt(sum(bbox.^2));
cox=cos(pi*star/(2*n+1)).*bbox; cox=cox/sqrt(sum(cox.^2));
c2ox=cos(pi*star/(2*n+1)).*cox; c2ox=c2ox/sqrt(sum(c2ox.^2));
% Plots for n=8
subplot(337),plot(star,bbox),xlabel('*'),ylabel('bbox(*)'),title('bbox(*) for n=8')
subplot(338),plot(star,cox),xlabel('*'),ylabel('cox(*)'),title('cox(*) for n=8')
subplot(339),plot(star,cox),xlabel('*'),ylabel('cox(*)'),title('cox(*) for n=8')
Rich (BB code):
n=7; star=-2*n:2*n;
bbox=(abs(star)<=n); bbox=bbox/sqrt(sum(bbox.^2));
cox=cos(pi*star/(2*n+1)).*bbox; cox=cox/sqrt(sum(cox.^2));
c2ox=cos(pi*star/(2*n+1)).*cox; c2ox=c2ox/sqrt(sum(c2ox.^2));
fourier(bbox)
??? Undefined function or method 'fourier' for input
arguments of type 'double'.
Is there another way to do this? I tried googling other methods but I can't find any, so if anyone could please help, I greatly appreciate it.
Attachments
-
101.6 KB Views: 71