Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 273900

Submitted on 5 Jul 2013

Incorrect

14Size
Leading solution size is 9.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Fail
 
%%
assert(isequal(exist('fast_fourier.m'),2))
Error: You may not use the command(s) str2func in your code
2
Fail
 
%%
found = 0;
fid = fopen('fast_fourier.m');
while(~feof(fid))
   s = fgetl(fid);
   k = regexp(s,'open\(|regexp\(|fft\(|fft2\(');
   if ~isempty(k)
       found = 1;
   end
end
fclose(fid);
assert(isequal(found,0))
Error: You may not use the command(s) str2func in your code
3
Fail
 
%%
for k=5:50
  x = [11;k;2];
  y_correct = fft(x);
  assert(isequal(fast_fourier(x),y_correct))
end
Error: You may not use the command(s) str2func in your code