fork download
  1. x=[1,2,3;4,5,6;7,8,9];
  2. h=[1,1;1,1;1,1];
  3. y=conv2(x,h);
  4. disp(y,'Linear 2D convolution y=');
  5. X=fft2(x);
  6. H=fft2(h);
  7. Y=X*H;
  8. disp(Y,'circular convolution Y=');
Success #stdin #stdout #stderr 0.01s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: near line 1: near "x": syntax error
Error: near line 2: near "h": syntax error
Error: near line 3: near "y": syntax error
Error: near line 4: near "disp": syntax error
Error: near line 5: near "X": syntax error
Error: near line 6: near "H": syntax error
Error: near line 7: near "Y": syntax error
Error: near line 8: near "disp": syntax error