% light double slit interference intensity and interference fringes
Clear,n=3;dphi= ( -1:0.01:1) *n*2*pi;
I=4*cos (DPHI/2). ^2;
Figure,subplot (2,1,1)
Plot (dphi,i, ' linewidth ', 2), grid On,axis tight
Set (GCA, ' XTick ', (-n:n) *2*pi)
Fs=16;title (' Light's double seam interference intensity and interference stripe ', ' fontsize ', FS)
Xlabel (' Difference \delta\it\phi ', ' fontsize ', FS)
Ylabel (' Relative Strength \iti/i\rm_0 ', ' fontsize ', FS)
Subplot (2,1,2), C=linspace (0,1,64) ';
ColorMap ([c,0*c,0*c]);
Image (I*16)
Axis Off,title (' light's double seam interference intensity and interference stripe ', ' fontsize ', FS)
The usage analysis of imshow and image
Same point:
Both imshow and image produce an image object.
The difference is as follows:
Two ways to use 1.imshow:
1) imshow (path and filename string)
2) imshow (image matrix)
If the current figure has an axis, Imshow will display the resulting image object (that is, the object) in the current axis;
If the current figure does not exist, Imshow produces a hidden axis and displays the resulting image object in it;
2.imshow (path and filename string) is equivalent to: m=imread (path and filename string); Imshow (M);
3.imshow does not expand the fill image data, that is, does not stretch the image to fill the axis, but change the axis aspect ratio to adapt to the image data;
The use of 4.image:
M=imread (path and filename string); image (M);
The 5.image does not change the size of the axis, but rather expands the fill image matrix so that it fills the axis area.