I realized that there are many things that could be done in Scilab. Things that could be done simpler compared with other languages.
As an exercise, we were given a code for creating a circular aperture. The code and the image produced are shown below.
nx = 100;
ny = 100;
x = linspace(-1,1,nx);
y = linspace(-1,1,ny);
[X,Y] = ndgrid(x,y);
r = sqrt(X.^2 + Y.^2);
A = zeros(nx,ny);
A(find(r<0.7)) = 1;
imshow(A);
Figures 2, 3, 4, 5, and 6 shows the produced output.
Figure 2. A centered square aperture |
Figure 3. A sinusoid which is along the x-direction |
Figure 4. A grating which is along the x-direction |
Figure 5. An annulus |
Figure 6. A gaussian transparency |
Self evaluation
I grade myself an 8. Technical correctness 4 and quality of presentation 4.
I had a VERY hard time installing the Scilab and SIVP. It only took me less than an hour to finish this activity. If given an ample time, I could have done a better job in this activity.
Reference:
ReplyDelete[1] Soriano, M. Activity 2 - Scilab Basics. 2012