I = imread('rice.png'); histogram(I,'BinLimits',[0 255],'BinMethod','integers') xlim([0 255])]]>

The new histogram() is nice. It could be a replacement for imhist() except for cases where you want to use standard bins 0-255 and 0-65535 instead of the automatically calculated bins that histogram uses. Do you think that imhist() and histogram() could be consolidated somehow into a single histogram function?

Also, MajorAxisLength is of limited usefulness because the definition (max length of an ellipse fitted to the shape) is not what people usually want, and that is the maximum Feret (caliper) diameter. And the min width would be the caliper diameter 90 degrees to the max caliper diameter. Do you think you could add this more useful measurement?

]]>Attempt to grow array along ambiguous dimension.

Error in RemoveBob (line 214)

rJiro(~jiro) = 0;

May be I should go to sleep and look at this another day :)

]]>KP

Using new RGB2LAB interface; please read the doc for that function, as there are other options that may prove helpful.

Showing results for new RGB2XYZ interface; please read the doc for that function, as there are other options that may prove helpful.

Using new RGB2LAB interface; please read the doc for that function, as there are other options that may prove helpful.

Showing results for new RGB2XYZ interface; please read the doc for that function, as there are other options that may prove helpful.

l can not like your post any more. it is great!

But, How did you know the freq. of aliasing signal is 70-60=10HZ rather than other freq., for aliasing is a random thing.What is your basis? ]]>

Thanks for your posts, they have been really usefull!

I wanted to ask you a question about the phase of 3D rect pulse.

I have been able to create a 3D rectangular pulse and to evaluate the fft of it, but when it comes to the phase it looks like it’s wrong shifted.

I mean it looks like matlab is receiving the pulse not centered in the way it is wanted, so the phase is multiplied for a linear shifting.

Is there a way to fix it, to have a correct phase’s graph?

Thank you in advance! I hope it’s the right place to ask you questions…

npoints=256;

perc=1;

dt=6*1E-7/(npoints*perc); % Tempo di campionamento

df=1/(npoints*dt); % Frequenza di campionamento

t(1)=0;

f(1)=0;

for k=2:npoints/2

t(k)=(k-1)*dt;

t(npoints-k+2)=-t(k);

f(k)=(k-1)*df;

f(npoints-k+2)=-f(k);

end

t(npoints/2+1)=t(npoints/2+2)-dt;

f(npoints/2+1)=f(npoints/2+2)-df;

ts=ifftshift(t);

fs=fftshift(f);

figure

[X,Y]=meshgrid(ts,ts);

D = npoints/2; % to indicate origin at the center of the function

a = 100; % change it to enlarge or reduce the pulse

y = repmat(1:npoints,npoints,1);

x = y’;

rect = zeros(npoints);

rect(D-a:D+a-1,D-a:D+a-1) = ones(2*a);

rect=ifftshift(rect);

surf(X,Y,rect);

shading interp

axis tight

title (‘Rect 3D’);

R = fft2(ifftshift(rect));

R = fftshift(R);

[X,Y]=meshgrid(fs,fs);

figure;

surf(X,Y,abs(R));

shading interp

axis tight

title(‘Fourier Transform of Rectangular function’);

%plot real part

figure;

surf(X,Y,real(R));

shading interp

axis tight

title(‘Real part’);

Rm=abs(R);

imm=imag(R);

re=real(R);

re(abs(re) < 1e-12) = 0;

imm(abs(imm) < 1e-12) = 0;

phase=atan2(imm, re);

%plot phase

[X,Y]=meshgrid(fs,fs);

figure

surf(X,Y,phase);

shading flat

axis tight

title ('Spettro di Fase rect');