Posted by: akawi June 1, 2007
Scilab programing topics
Login in to Rate this Post:     0       ?        
In my experience, the best way to learn programming is to write some code, run it and see what happens. If you are successful, the next step is to change some parameters and re-run. Of course you need to know the basic rules. Scilab is one of the programs I have been using for my work for last one and half years. I have found it quite useful and easy to learn. It is free-clone of Matlab. It have a lot of useful tools. Let us see what the following program does. If you find interesting I will explain about the codes in detail in my next postings. [note: before using the program you will need to download scilab from www.scilab.org] mode(-1) for k=1:1 if k<10 then kk='0'+string(k) else kk=string(k) end clf // rect=[-k,-k,k,k]; // tics=[1,2,1,2]; // plotframe(rect,tics) drawlater f=gcf() f.figure_size=[500,500] for theta=10:10:180 j=0 t=theta*%pi/180 for i=-3:0.1:3 j=j+1 y(j)=i x(j)=(1-y(j)^2/9) x(j)=x(j)^0.5*5 end for i=3:-0.1:-3 j=j+1 y(j)=i x(j)=(1-y(j)^2/9) x(j)=x(j)^0.5*5 x(j)=-x(j) end xnew=[x,y]*[cos(t),sin(t);sin(t),-cos(t)] x1=xnew(:,2) y1=xnew(:,1) plot(x1,y1,'-r') end a=gca() a.isoview="on" a.axes_visible = ["off","off","off"] drawnow // xs2gif(0,'c:/TEMP/'+kk+'.gif') end
Read Full Discussion Thread for this article