Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab imshow Pixel smoothing

  1. Apr 22, 2016 #1
    Hi. I have this code in matlab:

    / /
    I=dlmread('C:\Users\rshah\Desktop\Polymer Project\monteCarloCode\E=1e8.txt');

    F=fft2(I); F = fftshift(F); % Center FFT

    F = abs(F); % Get the magnitude since F is complex

    F = log(F+1); % Use log, for perceptual scaling, and +1 since log(0) is undefined

    [avg, s]=radialavg(F,30);
    subplot(2,2,1);imshow(F,[]);
    subplot(2,2,[3,4]);plot(s,avg);
    subplot(2,2,2);imshow(I,[]) //

    F is the fourier transform of my matrix of 1's and 0's which is 'I'. I would like to smooth both images so they do not appear pixelated like how in gnuplot we use interpolate.
    Im new to matlab and the syntax so sorry if this is something really easy. Thanks in advance
     
  2. jcsd
  3. Apr 27, 2016 #2
    Thanks for the post! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post?
     
  4. Apr 30, 2016 #3

    kreil

    User Avatar
    Gold Member

    The code cannot be run by anyone except you, since the text file you import is in a folder on your desktop. It would have been advisable to either attach the text file or the plots to the post. If you do that, you might be able to get a more detailed answer.

    In MATLAB the interpolation functions are interp1, interp2, interp3, and interpn. You probably just need to use interp1:

    http://www.mathworks.com/help/matlab/1-d-interpolation.html
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted