<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9101701713138538731</id><updated>2012-01-22T02:05:38.035-03:00</updated><category term='figure properties'/><category term='simulation'/><category term='math'/><category term='plot'/><category term='computer graphics'/><category term='statistic'/><category term='surfaces'/><category term='Scilab consortium'/><category term='lists'/><category term='videos'/><category term='files'/><category term='toolboxes'/><category term='graphs'/><category term='functions'/><category term='pattern recognition'/><category term='extended reality'/><category term='free software'/><category term='GPIB'/><category term='tensor'/><category term='FWHM'/><category term='matrix'/><category term='convolution'/><category term='logic operations'/><category term='start'/><category term='signal processing'/><category term='polynomials'/><category term='Presentation'/><category term='operations'/><category term='gesture recognition'/><category term='strings'/><category term='image processing'/><category term='numbers'/><category term='vector'/><category term='fft'/><category term='examples'/><category term='variables'/><category term='response in frequency'/><category term='filtering'/><category term='informations'/><title type='text'>How to Use Scilab</title><subtitle type='html'>Scilab is a software of scientific simulation.
It can operate with vectors, matrices, images, state space, and other kinds of situations.
I've been working with Scilab since 2005, and I always have success in my projects using Scilab.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>60</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2803308983191955012</id><published>2011-11-02T15:42:00.000-03:00</published><updated>2011-11-02T15:42:58.781-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='math'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><title type='text'>The highest number</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;It's known Scilab works as a calculator, displaying results of math operations.&lt;br /&gt;&lt;br /&gt;I was trying to obtain the highest number that Scilab can work with, so it's what I found:&lt;br /&gt;&lt;br /&gt;--&amp;gt;1.&lt;wbr&gt;&lt;/wbr&gt;797693134862315807999999999999&lt;wbr&gt;&lt;/wbr&gt;9999999999999999999999999e+308&lt;br /&gt;&amp;nbsp;ans&amp;nbsp; =&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.79D+308&amp;nbsp; &lt;br /&gt;&lt;br /&gt;--&amp;gt;1.797693134862315808e+308&lt;br /&gt;&amp;nbsp;ans&amp;nbsp; =&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inf&lt;br /&gt;&lt;br /&gt;It's a great number! And I think this number can attend all our needs for computations and operations.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2803308983191955012?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2803308983191955012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2803308983191955012&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2803308983191955012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2803308983191955012'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2011/11/highest-number.html' title='The highest number'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-102396272496847015</id><published>2011-10-12T12:52:00.000-03:00</published><updated>2011-10-12T12:52:28.844-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computer graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><title type='text'>Simulating physical events through computer graphics techniques - rectilinear motion</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Hi everyone, unfortunately my time is not being enough for making posts as I'd like to do.&lt;br /&gt;&lt;br /&gt;Let me share my situation: I'm working at morning and afternoon in a company and giving classes at night in a university.&lt;br /&gt;&lt;br /&gt;So, all days of my weeks are full of activities and studies. I wish to set my time better on the following days, because I like to make posts on my blogs and share something of what I know.&lt;br /&gt;&lt;br /&gt;In this post, I want to teach how to simulate a physical event using computer graphics techniques, just a comment: one of my disciplines in the university is computer graphics and we are using Scilab for the examples and exercises.&lt;br /&gt;&lt;br /&gt;Let's try to simulate some kinematics events, about &lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;rectilinear motions.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;For a first example, being a punctual object that's moving over a horizontal line (on the floor) and we wish to see this moving event by a top vision.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;The movement equation is&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt; &lt;i&gt;position = &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;i&gt;initial_&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;i&gt;position + velocity * time_variation&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;Now, writing the code:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;initial_&lt;/span&gt;&lt;/span&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;position = [0; 0]; //point that refers to initial position meaning [x_initial_coordinate; y_initial_coordinate]&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;velocity = [1; 2]; //vector velocity meaning [x_velocity_component; y_velocity_component]&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;time = [0:10]; //instants that we will create samples for showing on the screen&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;position = initial_position*ones(1, length(time)) + velocity*time; //this command implements the movement equation, and the matrix &lt;/span&gt;&lt;/span&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;ones(1, length(time)) is used for correcting the dimensions and makes the matrices sum possible&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;for t = 1:length(time), //this loop creates the graph dynamically simulating real motion&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&amp;nbsp;plot(&lt;/span&gt;&lt;/span&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;position(1,[1:t]), position(2,[1:t]), '.y');&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;plot(position(1,t), position(2,t), '.');&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&amp;nbsp;sleep(1000);&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;end;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;This code will show the last point of position with blue color and the other points with yellow color.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;Test the code and send me feedback of your feelings.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class="hps"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-102396272496847015?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/102396272496847015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=102396272496847015&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/102396272496847015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/102396272496847015'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2011/10/simulating-physical-events-through.html' title='Simulating physical events through computer graphics techniques - rectilinear motion'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-1592242872447415647</id><published>2011-02-11T21:33:00.000-03:00</published><updated>2011-02-11T21:33:59.982-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pattern recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='statistic'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Statistics operators mean and stdev</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Hi everyone, it's so much time without posts, but it's a new one for you.&lt;br /&gt;&lt;br /&gt;Let's see anything about two functions very useful in statistics: &lt;b&gt;mean()&lt;/b&gt; and &lt;b&gt;stdev()&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;The function mean() returns the mean of a set of data, e. g. vectors, matrices, etc. and the function stdev() returns the standard deviation of a set of data.&lt;br /&gt;&lt;br /&gt;Let's try some examples now.&lt;br /&gt;&lt;br /&gt;--&amp;gt;x = rand(1, 3)&lt;br /&gt;&amp;nbsp;x&amp;nbsp; =&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1708866&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.9025495&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.4888218&amp;nbsp; &lt;br /&gt;&lt;br /&gt;--&amp;gt;mean(x)&lt;br /&gt;&amp;nbsp;ans&amp;nbsp; =&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.5207526&amp;nbsp; &lt;br /&gt;&lt;br /&gt;--&amp;gt;stdev(x)&lt;br /&gt;&amp;nbsp;ans&amp;nbsp; =&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3668751&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;These functions are useful mainly in data mining, for example: two sets of data are given &lt;b&gt;x&lt;/b&gt; and &lt;b&gt;y&lt;/b&gt; (each data point has two dimensions), and it's necessary to identify a region in the data space for each set.&lt;br /&gt;&lt;br /&gt;For starting, we create the sets of data:&lt;br /&gt;&lt;br /&gt;x = rand(50, 2) + 1; // see &lt;a href="http://usingscilab.blogspot.com/2009/02/vectors-and-matrices-3.html"&gt;this link&lt;/a&gt;&lt;br /&gt;y = rand(50, 2, 'normal');&lt;br /&gt;&lt;br /&gt;For determining the regions, we use the functions &lt;b&gt;mean()&lt;/b&gt; and &lt;b&gt;stdev()&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;mean_x = mean(x, 'r');&lt;br /&gt;mean_y = mean(y, 'r');&lt;br /&gt;&lt;br /&gt;&lt;b&gt;mean_x&lt;/b&gt; and &lt;b&gt;mean_y&lt;/b&gt; are the centers of the sets of data, where each one has two components: mean_x = [x_xm x_ym] and mean_y = [y_xm y_ym] &lt;br /&gt;&lt;br /&gt;std_x = stdev(x);&lt;br /&gt;std_y = stdev(y);&lt;br /&gt;&lt;br /&gt;&lt;b&gt;std_x&lt;/b&gt; and &lt;b&gt;std_y&lt;/b&gt; are the distance from the centers to the boundaries of each region that we were looking for, or we can use a multiple of the standard deviation.&lt;br /&gt;&lt;br /&gt;In the example, the regions created were circles with center in the mean and radius &lt;b&gt;n&lt;/b&gt; times standard deviation, but we could try more complexes regions, or not?&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-1592242872447415647?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/1592242872447415647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=1592242872447415647&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1592242872447415647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1592242872447415647'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2011/02/statistics-operators-mean-and-stdev.html' title='Statistics operators mean and stdev'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3121566905713650221</id><published>2010-12-26T19:00:00.000-03:00</published><updated>2010-12-26T19:00:30.632-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='informations'/><category scheme='http://www.blogger.com/atom/ns#' term='Presentation'/><title type='text'>Merry Christmas and Happy New Year</title><content type='html'>Hi everyone, I'm very happy those days because I've started at my first job, I hadn't worked out of the university before.&lt;br /&gt;&lt;br /&gt;So I'm living out of my home, in another state, but now I'll restart to make posts in my blogs.&lt;br /&gt;&lt;br /&gt;I wish everyone were a merry Christmas and a blessed new year.&lt;br /&gt;&lt;br /&gt;And for my readers who have send questions, I ask you send me your questions again.&lt;br /&gt;&lt;br /&gt;Thank you for reading my blogs and let's study and learn.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3121566905713650221?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3121566905713650221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3121566905713650221&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3121566905713650221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3121566905713650221'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/12/merry-christmas-and-happy-new-year.html' title='Merry Christmas and Happy New Year'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-8545460276103618618</id><published>2010-11-04T10:59:00.001-03:00</published><updated>2010-11-04T11:00:26.716-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='informations'/><category scheme='http://www.blogger.com/atom/ns#' term='toolboxes'/><title type='text'>Thank you CV</title><content type='html'>I read four comments from CV today, and I'd like to say thank you CV, a reader like you motivates me to stay improving this blog.&lt;br /&gt;&lt;br /&gt;About your comments, try &lt;a href="http://atoms.scilab.org/toolboxes/Scilab_USB"&gt;this toolbox&lt;/a&gt; for USB connections and, about car plates, I'll make some posts for it.&lt;br /&gt;&lt;br /&gt;So, I'm happy with my readers and I ask God bless everyone.&lt;br /&gt;&lt;br /&gt;Thank you again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-8545460276103618618?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/8545460276103618618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=8545460276103618618&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8545460276103618618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8545460276103618618'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/11/thank-you-cv.html' title='Thank you CV'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-715471490958746602</id><published>2010-10-19T16:05:00.000-03:00</published><updated>2010-10-19T16:05:23.251-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='informations'/><category scheme='http://www.blogger.com/atom/ns#' term='Scilab consortium'/><title type='text'>Scilab consortium member</title><content type='html'>Today I was invited to take part in a community of math, science and technology based on Scilab software, it's &lt;a href="http://www.equalis.com/"&gt;Equalis&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I've been very happy because I believe Scilab is a great software and this software just needs people who help it to become better.&lt;br /&gt;&lt;br /&gt;Now, I'd like to invite my readers to make an account in Equalis' site, but I ask you don't forget my blog.&lt;br /&gt;&lt;br /&gt;So, it's all. Let's improve our applications using Scilab.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-715471490958746602?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/715471490958746602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=715471490958746602&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/715471490958746602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/715471490958746602'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/10/scilab-consortium-member.html' title='Scilab consortium member'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-653485151715922146</id><published>2010-07-28T16:11:00.000-03:00</published><updated>2010-07-28T16:11:46.694-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='signal processing'/><category scheme='http://www.blogger.com/atom/ns#' term='image processing'/><category scheme='http://www.blogger.com/atom/ns#' term='toolboxes'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><title type='text'>Car plate tracking</title><content type='html'>I found an old project that I developed during my graduation course which consists in a car plate tracking system.&lt;br /&gt;&lt;br /&gt;It was developed in Python in 2007, but I translated it to Scilab, in some minutes, today.&lt;br /&gt;&lt;br /&gt;I used SIVp toolbox and simple pattern recognition and digital image and signal processing techniques in this system.&lt;br /&gt;&lt;br /&gt;The system is tested with a set of images from a Brazilian repository which has many images of cars.&lt;br /&gt;&lt;br /&gt;Look the result of the system.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_IGuBPchcQ6w/TFCASt5iXSI/AAAAAAAAAeY/5pgz6MWZLUM/s1600/car_plate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/TFCASt5iXSI/AAAAAAAAAeY/5pgz6MWZLUM/s320/car_plate.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;If anyone is interested in this system, come on let's talk about it. We can try to improve it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-653485151715922146?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/653485151715922146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=653485151715922146&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/653485151715922146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/653485151715922146'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/07/car-plate-tracking.html' title='Car plate tracking'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_IGuBPchcQ6w/TFCASt5iXSI/AAAAAAAAAeY/5pgz6MWZLUM/s72-c/car_plate.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-4910109466496681424</id><published>2010-07-20T10:36:00.001-03:00</published><updated>2010-07-20T13:25:32.253-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GPIB'/><category scheme='http://www.blogger.com/atom/ns#' term='toolboxes'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Scilab for GPIB or USB devices</title><content type='html'>I received a comment &lt;a href="http://usingscilab.blogspot.com/2010/06/gpib-devices.html"&gt;here&lt;/a&gt; and the commenter wants to know how to connect a PC in a USB or GPIB device.&lt;br /&gt;&lt;br /&gt;Ric, you need to install the driver Visa and the toolbox that has functions to access the driver, you can try &lt;a href="http://www.scilab.org/contrib/index_contrib.php?page=displayContribution&amp;amp;fileID=288"&gt;this toolbox&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This driver, Visa, isn't free (open source) but you can download it in the web easily.&lt;br /&gt;&lt;br /&gt;So, if you, or anyone else, have any question, I'll try to help you again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-4910109466496681424?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/4910109466496681424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=4910109466496681424&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4910109466496681424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4910109466496681424'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/07/scilab-for-gpib-or-usb-scripts.html' title='Scilab for GPIB or USB devices'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-7764309339472672601</id><published>2010-06-22T13:20:00.006-03:00</published><updated>2010-06-22T13:55:11.171-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='informations'/><category scheme='http://www.blogger.com/atom/ns#' term='GPIB'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='free software'/><title type='text'>GPIB devices</title><content type='html'>I worked in a laboratory that works with wireless telecommunications.&lt;br /&gt;&lt;br /&gt;There, I developed a software that connects with ZVA 40 Network Analyzer (&lt;a href="http://www2.rohde-schwarz.com/"&gt;Rohde&amp;amp;Schwarz&lt;/a&gt; product). The software was first developed in Scilab (off course) and, later, I translated it to Python.&lt;br /&gt;&lt;br /&gt;Recently, I was recalled for solving a problem with the same device, because they were working with an Agilent's software. I think it's a great company and it products are very good, but Agilent's support couldn't solve the problem that they had.&lt;br /&gt;&lt;br /&gt;I wanna say Agilent has good solutions, but if the client has some problem, it probably won't be solved.&lt;br /&gt;&lt;br /&gt;So I though to help somebody more. I develop free software, it means I won't sell a product. I develop softwares as a service, and you'll pay me for what I've done.&lt;br /&gt;&lt;br /&gt;The software that I have connects to R&amp;amp;S ZVA 40, configures it and gets the signal plotting a graph and saving files. The configuration includes frequencies of capture, number of points, type of data (linear, log, polar, real part, imaginary part, Smith, etc) and the channel of capture: S11, S12, S21 and S22.&lt;br /&gt;&lt;br /&gt;Now, if you use any GPIB device and have problems with it, I'll help you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-7764309339472672601?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/7764309339472672601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=7764309339472672601&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7764309339472672601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7764309339472672601'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/06/gpib-devices.html' title='GPIB devices'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-9191326171344292986</id><published>2010-06-17T12:37:00.003-03:00</published><updated>2010-06-17T12:43:25.106-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='start'/><category scheme='http://www.blogger.com/atom/ns#' term='informations'/><category scheme='http://www.blogger.com/atom/ns#' term='Presentation'/><title type='text'>New layout</title><content type='html'>I've studied some web technologies and I decided to change my blog's layout.&lt;br /&gt;&lt;br /&gt;You can see the changes, but some news are coming soon to here.&lt;br /&gt;&lt;br /&gt;I thank to my readers, since January 2009 when I created this blog. I've learned too much with each one.&lt;br /&gt;&lt;br /&gt;I wish those days were a new begging in my blogs, and the new layout is just a sign of the future.&lt;br /&gt;&lt;br /&gt;Thank you again, and let's learn more about science using Scilab.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-9191326171344292986?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/9191326171344292986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=9191326171344292986&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/9191326171344292986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/9191326171344292986'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/06/new-layout.html' title='New layout'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-9050842771242665893</id><published>2010-05-01T09:59:00.003-03:00</published><updated>2010-05-01T10:05:43.956-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='informations'/><category scheme='http://www.blogger.com/atom/ns#' term='Presentation'/><title type='text'>M.Sc Engineer</title><content type='html'>Hi my readers, I'd like to share my happiness with you.&lt;br /&gt;&lt;br /&gt;I presented my master's dissertation last week, and it was accepted.&lt;br /&gt;&lt;br /&gt;Now, I'm an engineer and a master in engineering.&lt;br /&gt;&lt;br /&gt;I'm correcting the text, perhaps I won't be too fast for responding your questions, but I'll try not to harm anyone.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks for everyone who reads the blog, and God bless us.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-9050842771242665893?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/9050842771242665893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=9050842771242665893&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/9050842771242665893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/9050842771242665893'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/05/msc-engineer.html' title='M.Sc Engineer'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-4110849534913339877</id><published>2010-04-13T10:27:00.004-03:00</published><updated>2010-04-13T11:18:25.436-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='figure properties'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='surfaces'/><category scheme='http://www.blogger.com/atom/ns#' term='lists'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Multiple 3D plots using colors</title><content type='html'>I received an e-mail with a question like this: how to make three graphs using plot3d(.) function, and each graph's color is different?&lt;br /&gt;&lt;br /&gt;So, let's try it:&lt;br /&gt;&lt;br /&gt;//limits on 'x' axis&lt;br /&gt;X1 = 20;&lt;br /&gt;X2 = 30;&lt;br /&gt;X3 = 50;&lt;br /&gt;&lt;br /&gt;//limits on 'y' axis&lt;br /&gt;Y1 = 25;&lt;br /&gt;Y2 = 50;&lt;br /&gt;Y3 = 80;&lt;br /&gt;&lt;br /&gt;//variables 'x' and 'y', for each function&lt;br /&gt;[y1, x1] = meshgrid([1:Y1]', [1:X1]');&lt;br /&gt;[y2, x2] = meshgrid([1:Y2]', [1:X2]');&lt;br /&gt;[y3, x3] = meshgrid([1:Y3]', [1:X3]');&lt;br /&gt;&lt;br /&gt;//functions&lt;br /&gt;w1 = %pi/6;&lt;br /&gt;z1 = sin(w1*(x1 + y1));&lt;br /&gt;&lt;br /&gt;w2 = %pi/10;&lt;br /&gt;z2 = cos(w2*(x2 - y2)) + 5;&lt;br /&gt;&lt;br /&gt;z3 = tanh(x3 - y3) + 10;&lt;br /&gt;&lt;br /&gt;//conversion for plot3d(.)&lt;br /&gt;[xx1, yy1, zz1] = genfac3d(1:X1, 1:Y1, z1);&lt;br /&gt;[xx2, yy2, zz2] = genfac3d(1:X2, 1:Y2, z2);&lt;br /&gt;[xx3, yy3, zz3] = genfac3d(1:X3, 1:Y3, z3);&lt;br /&gt;&lt;br /&gt;//making graphs on the same screen&lt;br /&gt;plot3d(xx1, yy1, list(zz1, color("red")*ones(1, max(size(zz1)))));&lt;br /&gt;plot3d(xx2, yy2, list(zz2, color("green")*ones(1, max(size(zz2)))));&lt;br /&gt;plot3d(xx3, yy3, list(zz3, color("blue")*ones(1, max(size(zz3)))));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Or, if you prefer, you can use:&lt;br /&gt;&lt;br /&gt;//same of the three last lines&lt;br /&gt;plot3d([xx1 xx2 xx3], [yy1 yy2 yy3], list([zz1 zz2 zz3], [color("red")*ones(1, max(size(zz1))) color("green")*ones(1, max(size(zz2))) color("blue")*ones(1, max(size(zz3)))]));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, see the result:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/S8R8YahRKWI/AAAAAAAAAdI/GEktnlQo0go/s1600/multi_3d_color.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/S8R8YahRKWI/AAAAAAAAAdI/GEktnlQo0go/s400/multi_3d_color.png" alt="" id="BLOGGER_PHOTO_ID_5459625407157447010" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;So, it's all. Any question?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-4110849534913339877?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/4110849534913339877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=4110849534913339877&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4110849534913339877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4110849534913339877'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/04/multiple-3d-plots-using-colors.html' title='Multiple 3D plots using colors'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_IGuBPchcQ6w/S8R8YahRKWI/AAAAAAAAAdI/GEktnlQo0go/s72-c/multi_3d_color.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-6602406182494965324</id><published>2010-04-12T10:29:00.003-03:00</published><updated>2010-04-12T10:48:21.968-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='signal processing'/><category scheme='http://www.blogger.com/atom/ns#' term='FWHM'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Full width at half maximum</title><content type='html'>Hi everyone, I have a new reader and we talked about &lt;span style="font-weight: bold;"&gt;Full Width at Half Maximum - FWHM&lt;/span&gt; &lt;a href="http://usingscilab.blogspot.com/2009/08/making-functions.html"&gt;here&lt;/a&gt; (in the comments).&lt;br /&gt;&lt;br /&gt;We developed a code for finding the FWHM of a given peak in a function, and now the code will be posted in this post.&lt;br /&gt;&lt;br /&gt;function [fwhm_positions, fwhm_values] = fwhm(x, positions)&lt;br /&gt;tp = positions; //assign the peak position into tp&lt;br /&gt;&lt;br /&gt;t_aux = 1;&lt;br /&gt;while x(tp) &lt; 2*x(tp + t_aux),&lt;br /&gt;t_aux = t_aux + 1;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;fwhm_positions = (tp - t_aux):(tp + t_aux);&lt;br /&gt;fwhm_values = x((tp - t_aux):(tp + t_aux));&lt;br /&gt;endfunction;&lt;br /&gt;&lt;br /&gt;t = 1:1000;&lt;br /&gt;m = 350;&lt;br /&gt;s = 180;&lt;br /&gt;x = exp(-(1/(2*s))*(t - m).^2); // 'x' is a gaussian function&lt;br /&gt;&lt;br /&gt;plot(t, x);&lt;br /&gt;plot(fwhm_positions, fwhm_values, 'r.-');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, look the result following.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/S8MkaCIwQyI/AAAAAAAAAdA/hbBl80ymdIA/s1600/FWHM.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/S8MkaCIwQyI/AAAAAAAAAdA/hbBl80ymdIA/s400/FWHM.png" alt="" id="BLOGGER_PHOTO_ID_5459247202971960098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Thanks CV, you helped us too much!&lt;br /&gt;God bless you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-6602406182494965324?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/6602406182494965324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=6602406182494965324&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/6602406182494965324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/6602406182494965324'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/04/full-width-at-half-maximum.html' title='Full width at half maximum'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IGuBPchcQ6w/S8MkaCIwQyI/AAAAAAAAAdA/hbBl80ymdIA/s72-c/FWHM.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3776442243994365203</id><published>2010-03-21T13:17:00.002-03:00</published><updated>2010-03-21T13:25:11.557-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='informations'/><category scheme='http://www.blogger.com/atom/ns#' term='Presentation'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='free software'/><title type='text'>Professional R&amp;D and consulting</title><content type='html'>I have the blog &lt;a href="http://multisign.blogspot.com/"&gt;MultiSign&lt;/a&gt;, and I decided to begin a new work starting this week.&lt;br /&gt;&lt;br /&gt;I'm offering services of research and development (R&amp;amp;D) and consulting.&lt;br /&gt;&lt;br /&gt;I'll help everyone that asks me using this blog, the services of R&amp;amp;D and consulting are for "bigger helps" necessities.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://multisign.blogspot.com/2010/03/multisign-r-e-consulting.html"&gt;This&lt;/a&gt; is the advertising about what I'm offering. If you're interested, you may &lt;a href="http://www.blogger.com/profile/14503428177777397005"&gt;tell me&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Any questions, everyone can use this blog too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3776442243994365203?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3776442243994365203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3776442243994365203&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3776442243994365203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3776442243994365203'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/03/professional-r-and-consulting.html' title='Professional R&amp;D and consulting'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3419306405367499083</id><published>2010-03-15T19:01:00.003-03:00</published><updated>2010-03-15T19:16:05.398-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><category scheme='http://www.blogger.com/atom/ns#' term='fft'/><title type='text'>Discrete Fourier Transform - DFT</title><content type='html'>I made some posts about Discrete Fourier Transform (DFT), they're &lt;a href="http://usingscilab.blogspot.com/search/label/fft"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But, I received a comment asking me how to do a function that implements DFT.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let's only write a script, not optimized, that calculates DFT:&lt;br /&gt;&lt;br /&gt;function X = DFT(x)&lt;br /&gt;  n = length(x); //number of elements in 'x'&lt;br /&gt; &lt;br /&gt;  omega = exp(-2*%pi*%i/n);&lt;br /&gt;  j=0:(n - 1);&lt;br /&gt;  F=omega.^(j'*j);  //Fourier matrix&lt;br /&gt; &lt;br /&gt;  X = F*x(:); //X = DFT(x)&lt;br /&gt;endfunction;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If anyone wants to try the showed function, you could do like this:&lt;br /&gt;&lt;br /&gt;N = 10;&lt;br /&gt;x = rand(N, 1);&lt;br /&gt;&lt;br /&gt;X1 = DFT(x)&lt;br /&gt;X2 = dft(x, -1) // dft(.) function uses flag = -1 for direct transform and flag = 1 for inverse transform&lt;br /&gt;X3 = fft(x)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, look the values of X1, X2 and X3.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Did I help?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3419306405367499083?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3419306405367499083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3419306405367499083&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3419306405367499083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3419306405367499083'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/03/discrete-fourier-transform-dft.html' title='Discrete Fourier Transform - DFT'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-8526497555400575080</id><published>2010-03-09T10:03:00.004-03:00</published><updated>2010-03-09T10:23:07.755-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='polynomials'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Fractions with numerator and denominator</title><content type='html'>I received a comment &lt;a href="http://usingscilab.blogspot.com/2009/01/starting-scilab.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The commentator asked me how to show a fraction as same as it was inserted.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;x = 1/2;&lt;br /&gt;&lt;br /&gt;disp(x)&lt;br /&gt;1&lt;br /&gt;-&lt;br /&gt;2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, I made a simple form for it.&lt;br /&gt;&lt;br /&gt;--&gt;function [x] = frac(n, d)&lt;br /&gt;--&gt;  x = (n*%s)/(d*%s);&lt;br /&gt;--&gt;endfunction;&lt;br /&gt;&lt;br /&gt;--&gt;x1 = frac(1, 2);&lt;br /&gt;&lt;br /&gt;--&gt;disp(x1);&lt;br /&gt;&lt;br /&gt;   1 &lt;br /&gt;   - &lt;br /&gt;   2 &lt;br /&gt;&lt;br /&gt;--&gt;x2 = frac(2, 3);&lt;br /&gt;&lt;br /&gt;--&gt;disp(x2);&lt;br /&gt;&lt;br /&gt;   2 &lt;br /&gt;   - &lt;br /&gt;   3 &lt;br /&gt;&lt;br /&gt;--&gt;disp(x1 + x2);&lt;br /&gt;&lt;br /&gt;   7 &lt;br /&gt;   - &lt;br /&gt;   6 &lt;br /&gt;&lt;br /&gt;--&gt;disp(x1*x2);&lt;br /&gt;&lt;br /&gt;   2 &lt;br /&gt;   - &lt;br /&gt;   6 &lt;br /&gt;&lt;br /&gt;--&gt;x1 + 1&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;   3 &lt;br /&gt;   - &lt;br /&gt;   2 &lt;br /&gt;&lt;br /&gt;--&gt;x1 + x2 - 2&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt; - 5 &lt;br /&gt;   - &lt;br /&gt;   6 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS.: The element &lt;span style="font-weight: bold;"&gt;%s&lt;/span&gt; is used in polynomial definitions.&lt;br /&gt;&lt;br /&gt;Is it all right now?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-8526497555400575080?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/8526497555400575080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=8526497555400575080&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8526497555400575080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8526497555400575080'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/03/fractions-with-numerator-and.html' title='Fractions with numerator and denominator'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2528918217054585393</id><published>2010-02-11T09:30:00.002-03:00</published><updated>2010-02-11T09:46:35.415-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='strings'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>I'm back and writing about strings</title><content type='html'>Hi everyone, I couldn't post anything these days because my computer have been used a lot for my mastering. But finally, I finished the simulations and now I can return to my blogs.&lt;br /&gt;&lt;br /&gt;Let's do something with strings.&lt;br /&gt;&lt;br /&gt;First case: you have a matrix of strings like following:&lt;br /&gt;&lt;br /&gt;mat1 = ['john', 'Simon', 'Tonny'; 'jim', 'sam', 'phill'];&lt;br /&gt;&lt;br /&gt;And you want a standard in the strings, look 'Simon' and 'Tonny' have capital letters ('S' and 'T').&lt;br /&gt;&lt;br /&gt;Thus, we use convstr(.) function, as following:&lt;br /&gt;&lt;br /&gt;mat1 = ['john', 'Simon', 'Tonny'; 'jim', 'sam', 'phill'];&lt;br /&gt;&lt;br /&gt;mat_std_u = convstr(mat1, 'u')&lt;br /&gt; mat_std_u  =&lt;br /&gt;&lt;br /&gt;!JOHN  SIMON  TONNY  !&lt;br /&gt;!                    !&lt;br /&gt;!JIM   SAM    PHILL  !&lt;br /&gt;&lt;br /&gt;mat_std_l = convstr(mat1, 'l')&lt;br /&gt; mat_std_l  =&lt;br /&gt;&lt;br /&gt;!john  simon  tonny  !&lt;br /&gt;!                    !&lt;br /&gt;!jim   sam    phill  !&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And it's right now, all letters are in the same type.&lt;br /&gt;&lt;br /&gt;If anyone wants anything more about string, ask me.&lt;br /&gt;&lt;br /&gt;See you soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2528918217054585393?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2528918217054585393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2528918217054585393&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2528918217054585393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2528918217054585393'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/02/im-back-and-writing-about-strings.html' title='I&apos;m back and writing about strings'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-7172956984088390442</id><published>2010-01-15T08:57:00.003-03:00</published><updated>2010-01-15T09:59:28.215-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Presentation'/><title type='text'>First of 2010</title><content type='html'>&lt;div style="text-align: center;"&gt;Happy and blessed 2010 for everyone!&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Hi readers, I ask apologies for my absence.&lt;br /&gt;&lt;br /&gt;My computer was working in my MSc's project and I couldn't make new posts here.&lt;br /&gt;&lt;br /&gt;I received some comments, like &lt;a href="http://usingscilab.blogspot.com/2009/06/plotting-vectors.html"&gt;this&lt;/a&gt; and &lt;a href="http://usingscilab.blogspot.com/2009/07/color-vectors.html"&gt;this&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I'll answer your questions soon, when I come back from a travel in Jan, 25.&lt;br /&gt;&lt;br /&gt;However, I say I haven't found anything about the vectors' colors.&lt;br /&gt;&lt;br /&gt;If anyone knows how to control the colors of the arrows, in the champ(.) function, I ask you comment here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-7172956984088390442?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/7172956984088390442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=7172956984088390442&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7172956984088390442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7172956984088390442'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2010/01/first-of-2010.html' title='First of 2010'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-1012037172737956877</id><published>2009-12-02T09:33:00.004-03:00</published><updated>2009-12-02T09:44:09.202-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='videos'/><category scheme='http://www.blogger.com/atom/ns#' term='image processing'/><category scheme='http://www.blogger.com/atom/ns#' term='gesture recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='toolboxes'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><title type='text'>SIRENE's prototype</title><content type='html'>I've developed a prototype of my Mastering project, called SIRENE (acronym in Portuguese).&lt;br /&gt;&lt;br /&gt;This project is a system of gesture recognition for the LIBRAS' (Brazilian Sign Language) signs.&lt;br /&gt;&lt;br /&gt;This system can be used with any set of gestures made with hands.&lt;br /&gt;&lt;br /&gt;The following video was made for an event (&lt;a href="http://www.interaction-southamerica.org/sobre/?lang=en"&gt;here&lt;/a&gt;), and I presented it there.&lt;br /&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/3uV5pK6IxwQ&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/3uV5pK6IxwQ&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;The word "Gravando" means &lt;span style="font-weight: bold;"&gt;Recording&lt;/span&gt; and "Testando" means &lt;span style="font-weight: bold;"&gt;Testing&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The system that I'm studying is able to recognize 26 gestures, but this prototype is able to recognize only 5 ones.&lt;br /&gt;&lt;br /&gt;Of course, this prototype was developed using Scilab and the toolbox SIVp.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-1012037172737956877?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/1012037172737956877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=1012037172737956877&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1012037172737956877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1012037172737956877'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/12/sirenes-prototype.html' title='SIRENE&apos;s prototype'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2353964204900091909</id><published>2009-11-05T12:08:00.002-03:00</published><updated>2009-11-05T12:19:00.799-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='signal processing'/><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><category scheme='http://www.blogger.com/atom/ns#' term='fft'/><title type='text'>More frequencies in FFT</title><content type='html'>Hi Transmogrifox, thank you very much for your help. We have this blog to interact and to help ourselves.&lt;br /&gt;&lt;br /&gt;The Transmogrifox's code is given following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Frequency components of a signal&lt;br /&gt;//----------------------------&lt;wbr&gt;------&lt;br /&gt;// build a noides signal sampled at 1000hz  containing to pure frequencies&lt;br /&gt;// at 50 and 70 Hz&lt;br /&gt;sample_rate=1000;&lt;br /&gt;t = 0:1/sample_rate:0.6;&lt;br /&gt;N=size(t,'*'); //number of samples&lt;br /&gt;s=sin(2*%pi*50*t)+ 0.3*sin(2*%pi*70*t+%pi/4)+ 0.2*grand(1,N,'nor',0,1);&lt;br /&gt;&lt;br /&gt;y=fft(s);&lt;br /&gt;//the fft response is symetric we retain only the first N/2 points&lt;br /&gt;f=sample_rate*(0:(N/2))/N; //associated frequency vector&lt;br /&gt;n=size(f,'*')&lt;br /&gt;yy = y*2/N;&lt;br /&gt;clf()&lt;br /&gt;plot2d(f,abs(yy(1:n)))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And the following picture is the result.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SvLsckEpoTI/AAAAAAAAAcg/NMoZIgvvYhg/s1600-h/transmogrifox.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SvLsckEpoTI/AAAAAAAAAcg/NMoZIgvvYhg/s320/transmogrifox.png" alt="" id="BLOGGER_PHOTO_ID_5400638878634320178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So, if anyone has any question, I think I and Transmogrifox are ready for help.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2353964204900091909?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2353964204900091909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2353964204900091909&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2353964204900091909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2353964204900091909'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/11/more-frequencies-in-fft.html' title='More frequencies in FFT'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_IGuBPchcQ6w/SvLsckEpoTI/AAAAAAAAAcg/NMoZIgvvYhg/s72-c/transmogrifox.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2979287992573185570</id><published>2009-10-27T10:10:00.003-03:00</published><updated>2009-10-27T10:47:22.377-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='response in frequency'/><category scheme='http://www.blogger.com/atom/ns#' term='polynomials'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Response in frequency</title><content type='html'>Hi Cek, I saw your comment (&lt;a href="http://usingscilab.blogspot.com/2009/09/for-my-readers.html"&gt;here&lt;/a&gt;), and I'd like to say that I never worked with these functions before. But we can learn about the functions.&lt;br /&gt;&lt;br /&gt;Let's start with the &lt;span style="font-weight: bold; font-style: italic;"&gt;freq(.)&lt;/span&gt; function.&lt;br /&gt;&lt;br /&gt;This code is the example in Scilab's help.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;s = poly(0, 's');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;sys = (s+1)/(s^3-5*s+4)&lt;/span&gt;;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;rep = freq(sys("num"), sys("den"), [0,0.9,1.1,2,3,10,20])&lt;/span&gt;;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;[horner(sys, 0), horner(sys, 20)]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Sys = tf2ss(sys);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;[A, B, C, D] = abcd(Sys);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;freq(A, B, C, [0, 0.9, 1.1, 2, 3, 10, 20])&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the code, we see the function freq(.) is used with polynomials (in the Space of Laplace). The last argument (the vector &lt;span style="font-style: italic;"&gt;[0, 0.9, 1.1, 2, 3, 10, 20]&lt;/span&gt;) represents the calculated frequencies for the polynomial &lt;span style="font-style: italic;"&gt;sys&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The function &lt;span style="font-weight: bold; font-style: italic;"&gt;tf2ss(.)&lt;/span&gt; means &lt;span style="font-weight: bold;"&gt;time/frequency to state-space&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The function &lt;span style="font-weight: bold; font-style: italic;"&gt;refreq(.)&lt;/span&gt; does the same things of the function &lt;span style="font-weight: bold; font-style: italic;"&gt;freq(.)&lt;/span&gt;, but it uses other arguments.&lt;br /&gt;&lt;br /&gt;Look the function's description, in Scilab's help.&lt;br /&gt;&lt;br /&gt;[ [frq,] repf] = repfreq(sys, fmin, fmax [, step]) &lt;br /&gt;[ [frq,] repf] = repfreq(sys [, frq]) &lt;br /&gt;[ frq, repf, splitf] = repfreq(sys, fmin, fmax [, step]) &lt;br /&gt;[ frq, repf, splitf] = repfreq(sys [, frq]) &lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Parameters&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;sys: syslin list : SIMO linear system&lt;br /&gt;fmin, fmax: two real numbers (lower and upper frequency bounds)&lt;br /&gt;frq: real vector of frequencies (Hz)&lt;br /&gt;step: logarithmic discretization step&lt;br /&gt;splitf: vector of indexes of critical frequencies.&lt;br /&gt;repf: vector of the complex frequency response&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The function &lt;span style="font-weight: bold; font-style: italic;"&gt;horner(.)&lt;/span&gt; evaluates a polynomial in a specific point, for example:&lt;br /&gt;&lt;br /&gt;s = poly(0,'s');&lt;br /&gt;M = [s, 1/s]; // M is the polynomial in analysis&lt;br /&gt;x1 = horner(M,1)&lt;br /&gt;x1&lt;br /&gt; x1  =&lt;br /&gt;&lt;br /&gt;    1.    1. &lt;br /&gt;&lt;br /&gt;x2 = horner(M,%i)&lt;br /&gt; x2  =&lt;br /&gt;&lt;br /&gt;    i    - i   &lt;br /&gt;&lt;br /&gt;x3 = horner(M,1/s)&lt;br /&gt; x3  =&lt;br /&gt;&lt;br /&gt;    1     s  &lt;br /&gt;    -     -  &lt;br /&gt;    s     1  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you want, then we can try to learn anything about the others functions: bode, syslin and csim.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2979287992573185570?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2979287992573185570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2979287992573185570&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2979287992573185570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2979287992573185570'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/10/response-in-frequency.html' title='Response in frequency'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3631990122786582747</id><published>2009-10-23T11:52:00.003-03:00</published><updated>2009-10-23T12:22:11.396-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><title type='text'>Operations element by element, again</title><content type='html'>Hi Jackmatze, how are you? I think you are just as old as me, but it's other thing.&lt;br /&gt;About your question, I made a post that answers you: it's &lt;a href="http://usingscilab.blogspot.com/2009/03/operations-element-by-element.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So, let me show an example:&lt;br /&gt;&lt;br /&gt;--&gt;matrix1 = [1 2 1;&lt;br /&gt;--&gt;2 1 2;&lt;br /&gt;--&gt;1 2 3]&lt;br /&gt; matrix1  =&lt;br /&gt;&lt;br /&gt;    1.    2.    1. &lt;br /&gt;    2.    1.    2. &lt;br /&gt;    1.    2.    3. &lt;br /&gt;&lt;br /&gt;--&gt;matrix2 = [1 1 2;&lt;br /&gt;--&gt;0 2 1;&lt;br /&gt;--&gt;1 3 1]&lt;br /&gt; matrix2  =&lt;br /&gt;&lt;br /&gt;    1.    1.    2. &lt;br /&gt;    0.    2.    1. &lt;br /&gt;    1.    3.    1. &lt;br /&gt;&lt;br /&gt;--&gt;matrix_t = matrix1*matrix2&lt;br /&gt; matrix_t  =&lt;br /&gt;&lt;br /&gt;    2.    8.     5. &lt;br /&gt;    4.    10.    7. &lt;br /&gt;    4.    14.    7. &lt;br /&gt;&lt;br /&gt;--&gt;matrix_dott = matrix1.*matrix2&lt;br /&gt; matrix_dott  =&lt;br /&gt;&lt;br /&gt;    1.    2.    2. &lt;br /&gt;    0.    2.    2. &lt;br /&gt;    1.    6.    3. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, what's the difference of &lt;span style="font-style: italic;"&gt;matrix1^2&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;matrix1.^2&lt;/span&gt;?&lt;br /&gt;&lt;br /&gt;matrix1^2 = matrix1*matrix1&lt;br /&gt;&lt;br /&gt;matrix1.^2 = matrix1.*matrix1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok, Jack? Anything more, I'll try to help you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3631990122786582747?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3631990122786582747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3631990122786582747&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3631990122786582747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3631990122786582747'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/10/operations-element-by-element-again.html' title='Operations element by element, again'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2448797924114326158</id><published>2009-10-23T11:27:00.004-03:00</published><updated>2009-10-23T11:51:53.568-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='signal processing'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='fft'/><title type='text'>Peaks in FFT transformation</title><content type='html'>Hi Kaustubh, excuse me for the time of the answer.&lt;br /&gt;&lt;br /&gt;Do you want to know about the peaks in the FFT transformation (&lt;a href="http://usingscilab.blogspot.com/2009/08/fft-specifying-frequencies.html"&gt;here&lt;/a&gt;), right?&lt;br /&gt;&lt;br /&gt;Well, this blog is about Scilab, and you can find what you want in any book of Digital Signal Processing.&lt;br /&gt;&lt;br /&gt;But God loves you and I'll try to explain what the peaks mean.&lt;br /&gt;&lt;br /&gt;Think in a pure frequency signal &lt;span style="font-style: italic;"&gt;x(t)&lt;/span&gt; like a sine or cosine, it has only the own frequency (&lt;span style="font-style: italic;"&gt;f0&lt;/span&gt;). The FFT transform is two impulses (&lt;span style="font-style: italic;"&gt;X(f) = d(-f0) + d(f0)&lt;/span&gt;) (similar to &lt;a href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SoAw7uP4mMI/AAAAAAAAAag/JS1ssBLxmTk/s1600-h/frequencies_correct-fft.png"&gt;this figure&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;If you plot the FFT transform of x(t), then you obtain the peaks in &lt;span style="font-style: italic;"&gt;-f0&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;f0&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Now, think in a signal composed by two pure frequency signals, &lt;span style="font-style: italic;"&gt;y(t) = x1(t) + x2(t)&lt;/span&gt;, of different frequencies (&lt;span style="font-style: italic;"&gt;f1&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;f2&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;The FFT transform of &lt;span style="font-style: italic;"&gt;y(t)&lt;/span&gt; is four impulses, two for &lt;span style="font-style: italic;"&gt;x1(t)&lt;/span&gt; and two for &lt;span style="font-style: italic;"&gt;x2(t)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;If &lt;span style="font-style: italic;"&gt;x1(t)&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;x2(t)&lt;/span&gt; have different amplitudes, for example: &lt;span style="font-style: italic;"&gt;x1(t) = cos(2t)&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;x2(t) = 3 cos(5t)&lt;/span&gt;, then the peaks of the FFT transform of &lt;span style="font-style: italic;"&gt;y(t)&lt;/span&gt; are weighted,&lt;br /&gt;&lt;br /&gt;Following the example, the FFT transform of &lt;span style="font-style: italic;"&gt;x1(t)&lt;/span&gt; is &lt;span style="font-style: italic;"&gt;X1(f) = d(-f1) + d(f1)&lt;/span&gt; and the FFT transformation of &lt;span style="font-style: italic;"&gt;x2(t)&lt;/span&gt; is &lt;span style="font-style: italic;"&gt;X2(t) = 3(d(-f2) + d(f2))&lt;/span&gt;. So, the FFT transform of &lt;span style="font-style: italic;"&gt;y(t) = x1(t) + x2(t)&lt;/span&gt; is &lt;span style="font-style: italic;"&gt;Y(f) = X1(f) + X2(f) = (d(-f1) + d(f1)) + 3(d(-f2) + d(f2))&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, if you have a real signal &lt;span style="font-style: italic;"&gt;xr(t)&lt;/span&gt;, it has many frequencies and it FFT transform &lt;span style="font-style: italic;"&gt;XR(f)&lt;/span&gt; presents many peaks, one by each frequency. The peaks' amplitude represents the amplitude of each frequency in &lt;span style="font-style: italic;"&gt;xr(t)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;My friend, I said this not a blog about Signal Processing, but I tried to help you.&lt;br /&gt;If you have more question, I'll try to help you again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2448797924114326158?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2448797924114326158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2448797924114326158&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2448797924114326158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2448797924114326158'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/10/peaks-in-fft-transformation.html' title='Peaks in FFT transformation'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2917118950343691102</id><published>2009-10-20T07:55:00.004-03:00</published><updated>2009-10-20T08:19:14.278-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='tensor'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Tensors</title><content type='html'>Hi Michele, how are you?&lt;br /&gt;&lt;br /&gt;First, I'm sorry because I'm not an expert in multi linear algebra and I don't know many things about tensors.&lt;br /&gt;&lt;br /&gt;In a fast search, I saw tensors are like matrices with high dimensionality.&lt;br /&gt;&lt;br /&gt;Correct me if I were wrong.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;tensor1 = zeros(3, 3, 3); // it's a tensor&lt;br /&gt;&lt;br /&gt;tensor2 = ones(5, 5, 4); // it's other tensor&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I found one function that works with tensors: &lt;span style="font-weight: bold; font-style: italic;"&gt;kron(.)&lt;/span&gt;. It returns the Kronecker tensor product of two matrices &lt;span style="font-weight: bold;"&gt;A&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;B&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The function &lt;span style="font-weight: bold; font-style: italic;"&gt;kron(.)&lt;/span&gt; is called like following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A=[1,2;3,4];&lt;br /&gt;&lt;br /&gt;kron(A,A)&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;   1.    2.     2.     4. &lt;br /&gt;   3.    4.     6.     8. &lt;br /&gt;   3.    6.     4.     8. &lt;br /&gt;   9.    12.    12.    16.&lt;br /&gt;&lt;br /&gt;A.*.A // this operator (.*.) implements the Kronecker tensor product of two matrices, look the results are the same kron(A, A) == A.*.A&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;   1.    2.     2.     4. &lt;br /&gt;   3.    4.     6.     8. &lt;br /&gt;   3.    6.     4.     8. &lt;br /&gt;   9.    12.    12.    16.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I think it's something about tensors.&lt;br /&gt;If anyone has a comment or suggestion, I ask for you share your knowledge with us.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2917118950343691102?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2917118950343691102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2917118950343691102&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2917118950343691102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2917118950343691102'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/10/tensors.html' title='Tensors'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2512374254710768192</id><published>2009-10-08T10:35:00.004-03:00</published><updated>2009-10-08T10:52:41.898-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image processing'/><category scheme='http://www.blogger.com/atom/ns#' term='toolboxes'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='extended reality'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Topics of Digital Image Processing</title><content type='html'>Hi Wahlau, I saw your comment but I couldn't answer it before. Thank you for your words to me.&lt;br /&gt;&lt;br /&gt;I have another &lt;a href="http://multisign.blogspot.com/"&gt;blog&lt;/a&gt; and I made some posts about &lt;a href="http://multisign.blogspot.com/search/label/digital%20image%20processing?max-results=20"&gt;Image Processing&lt;/a&gt; and &lt;a href="http://multisign.blogspot.com/search/label/segmenta%C3%A7%C3%A3o"&gt;Segmentation&lt;/a&gt; (in Portuguese).&lt;br /&gt;&lt;br /&gt;If you want to develop anything like the interactive ball, then you should learn about skin segmentation and how to interact the virtual ball with the segmented region.&lt;br /&gt;&lt;br /&gt;The simplest algorithm for skin segmentation is the threshold in the channels of color Cb and Cr (in images coded in YCbCr).&lt;br /&gt;&lt;br /&gt;The toolbox &lt;a href="http://sivp.sourceforge.net/"&gt;SIVp&lt;/a&gt; has functions for read, write, show, convert, and others operations with images. That toolbox is too simple for install, if you use GNU/Linux, you can install it using the apt-get or synaptic.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS.: In my other blog, I posted some codes in Scilab for skin segmentation, and anything more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2512374254710768192?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2512374254710768192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2512374254710768192&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2512374254710768192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2512374254710768192'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/10/topics-of-digital-image-processing.html' title='Topics of Digital Image Processing'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2659368578177767697</id><published>2009-10-06T10:55:00.004-03:00</published><updated>2009-10-06T11:17:24.686-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='surfaces'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Excuses</title><content type='html'>Hi Stanley and Naza, I'm sorry I couldn't answer your questions because I'm writing my dissertation and I needed to make two articles too.&lt;br /&gt;&lt;br /&gt;So, I ask for you explain better what you want.&lt;br /&gt;&lt;br /&gt;Stanley, I think the &lt;span style="font-weight: bold; font-style: italic;"&gt;meshgrid()&lt;/span&gt; function can help you, like following:&lt;br /&gt;&lt;br /&gt;N = 20;&lt;br /&gt;x_range = -1:2/(N - 1):1;&lt;br /&gt;y_range = -1:1.2/(N - 1):0.2;&lt;br /&gt;&lt;br /&gt;[x y] = meshgrid(x_range, y_range);&lt;br /&gt;&lt;br /&gt;P = [];&lt;br /&gt;for i1 = 1:N,&lt;br /&gt;for i2 = 1:N,&lt;br /&gt;P(i2,i1) = color_P(i1, i2); //here you put the function P = f(x, y)&lt;br /&gt;end;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;---------------&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;For plot the graph, you can use the &lt;span style="font-weight: bold; font-style: italic;"&gt;fplot3d1(.)&lt;/span&gt; function. The following picture shows a example:&lt;br /&gt;&lt;br /&gt;deff('z=f(x,y)','z=x^4-y')&lt;br /&gt;&lt;br /&gt;x=-3:0.2:3 ;y=x ;&lt;br /&gt;&lt;br /&gt;fplot3d1(x, y, f, alpha = 0, theta = 0); // alpha and theta are the rotation angles&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SstQuPSWSBI/AAAAAAAAAcY/53oz0qvCSMc/s1600-h/fplot3d1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SstQuPSWSBI/AAAAAAAAAcY/53oz0qvCSMc/s400/fplot3d1.png" alt="" id="BLOGGER_PHOTO_ID_5389490134386624530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now, you study the &lt;span style="font-weight: bold; font-style: italic;"&gt;fplot3d1(.)&lt;/span&gt; function for make your own graph.&lt;br /&gt;&lt;br /&gt;The presented function plots graphs as surfaces if you change the variables alpha and theta (try &lt;span style="font-style: italic;"&gt;alpha = 5&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;theta = 30&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;That's all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2659368578177767697?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2659368578177767697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2659368578177767697&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2659368578177767697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2659368578177767697'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/10/excuses.html' title='Excuses'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_IGuBPchcQ6w/SstQuPSWSBI/AAAAAAAAAcY/53oz0qvCSMc/s72-c/fplot3d1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-4058280581049785312</id><published>2009-10-01T15:24:00.006-03:00</published><updated>2009-10-01T15:50:23.581-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='convolution'/><category scheme='http://www.blogger.com/atom/ns#' term='filtering'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Digital Signal Processing - intro</title><content type='html'>Hi Wallace, I'd like to know what algorithm, or kind of algorithm, you need to develop.&lt;br /&gt;&lt;br /&gt;I made a post about convolution, but I think it's a good, and simple, subject for we start our studies.&lt;br /&gt;&lt;br /&gt;Look the noised signal:&lt;br /&gt;&lt;br /&gt;--&gt;T = 100;&lt;br /&gt;&lt;br /&gt;--&gt;t = 1:T;&lt;br /&gt;&lt;br /&gt;--&gt;w = %pi/10;&lt;br /&gt;&lt;br /&gt;--&gt;s = cos(w*t); //pure signal&lt;br /&gt;&lt;br /&gt;--&gt;n = rand(1, T, 'normal')*0.1; //noise&lt;br /&gt;&lt;br /&gt;--&gt;x = s + n;                       &lt;br /&gt;&lt;br /&gt;--&gt;plot(t, x);                      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SsT2hV84wAI/AAAAAAAAAcA/mZ_ohbXviRA/s1600-h/cos_noised.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SsT2hV84wAI/AAAAAAAAAcA/mZ_ohbXviRA/s400/cos_noised.png" alt="" id="BLOGGER_PHOTO_ID_5387702106930593794" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now, let's filter the signal using an average filter.&lt;br /&gt;&lt;br /&gt;We have two options for apply the filtering:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;The first&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;--&gt;Tm = 5;&lt;br /&gt;&lt;br /&gt;--&gt;y = [];&lt;br /&gt;&lt;br /&gt;--&gt;for i = 1:Tm,&lt;br /&gt;--&gt;y(i) = mean(x(1:i));&lt;br /&gt;--&gt;end;&lt;br /&gt;&lt;br /&gt;--&gt;for i = (Tm + 1):T,&lt;br /&gt;--&gt;y(i) = mean(x((i - Tm):i));&lt;br /&gt;--&gt;end;&lt;br /&gt;&lt;br /&gt;--&gt;plot(t, y);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SsT4nR9oKTI/AAAAAAAAAcI/OGZBhHG0yqc/s1600-h/cos_filter.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SsT4nR9oKTI/AAAAAAAAAcI/OGZBhHG0yqc/s400/cos_filter.png" alt="" id="BLOGGER_PHOTO_ID_5387704407962429746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;The second&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;--&gt;Tm = 5;&lt;br /&gt;&lt;br /&gt;--&gt;m = ones(1, Tm);&lt;br /&gt;&lt;br /&gt;--&gt;y = convol(x, m);&lt;br /&gt;&lt;br /&gt;--&gt;ty = 1:length(y);&lt;br /&gt;&lt;br /&gt;--&gt;plot(ty, y);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SsT5TfCwvaI/AAAAAAAAAcQ/D3BdCvVThQo/s1600-h/cos_convol.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 250px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SsT5TfCwvaI/AAAAAAAAAcQ/D3BdCvVThQo/s400/cos_convol.png" alt="" id="BLOGGER_PHOTO_ID_5387705167387868578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;If you make the math operations, you'll see the results are, numerically, the same for t = Tm + 1 until t = T.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-4058280581049785312?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/4058280581049785312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=4058280581049785312&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4058280581049785312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4058280581049785312'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/10/digital-signal-processing-intro.html' title='Digital Signal Processing - intro'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_IGuBPchcQ6w/SsT2hV84wAI/AAAAAAAAAcA/mZ_ohbXviRA/s72-c/cos_noised.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-7607138846520389142</id><published>2009-09-22T14:47:00.003-03:00</published><updated>2009-09-22T14:52:21.988-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='Presentation'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><title type='text'>For my readers</title><content type='html'>&lt;div id="result_box" dir="ltr"&gt;I thought my readers will like to know the videos, in the last post, but nobody made any comment.&lt;br /&gt;&lt;br /&gt;So, I thought my readers should choose the next subject.&lt;br /&gt;&lt;br /&gt;I think the basic commands are well presented here.&lt;br /&gt;&lt;br /&gt;I'd like to propose some subjects:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Digital image processing&lt;/li&gt;&lt;li&gt;Digital signal processing&lt;/li&gt;&lt;li&gt;Advanced Graphs&lt;/li&gt;&lt;li&gt;Advanced algebraic manipulations&lt;/li&gt;&lt;/ul&gt;Now, you choose the next post.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-7607138846520389142?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/7607138846520389142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=7607138846520389142&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7607138846520389142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7607138846520389142'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/09/for-my-readers.html' title='For my readers'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-7075554000723693585</id><published>2009-09-10T11:24:00.002-03:00</published><updated>2009-09-10T11:32:08.918-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='videos'/><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='extended reality'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><title type='text'>Videos in YouTube</title><content type='html'>I was looking my YouTube's account today, and I saw some videos that I made using Scilab.&lt;br /&gt;&lt;br /&gt;If anyone wants to see the videos, this is my Channel in YouTube: http://www.youtube.com/alexsheep7&lt;br /&gt;&lt;br /&gt;Following two great videos.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;A simple code that shows graphs.&lt;br /&gt;&lt;/div&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/5zvOg-21oxg&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/5zvOg-21oxg&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;A more complex code that implements extended reality.&lt;br /&gt;&lt;/div&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/jQh5_B1O_3o&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/jQh5_B1O_3o&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-7075554000723693585?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/7075554000723693585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=7075554000723693585&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7075554000723693585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7075554000723693585'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/09/videos-in-youtube.html' title='Videos in YouTube'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-5992347414812644109</id><published>2009-09-07T14:30:00.006-03:00</published><updated>2009-09-07T14:46:04.289-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='convolution'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><category scheme='http://www.blogger.com/atom/ns#' term='fft'/><title type='text'>Discrete convolution properties - 2</title><content type='html'>Anyone called Younes asked something about convolution via Fourier Transform.&lt;br /&gt;I made the following deduction for you Younes (click on the image for see it in the real size):&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SqVGxGTYoCI/AAAAAAAAAb4/IIMz7LRQp3M/s1600-h/conv_fft.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 227px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SqVGxGTYoCI/AAAAAAAAAb4/IIMz7LRQp3M/s400/conv_fft.png" alt="" id="BLOGGER_PHOTO_ID_5378783139283378210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now, I ask: try to confirm the property using Scilab.&lt;br /&gt;&lt;br /&gt;Don't forget computers don't make infinity operations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-5992347414812644109?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/5992347414812644109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=5992347414812644109&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/5992347414812644109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/5992347414812644109'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/09/discrete-convolution-properties-2.html' title='Discrete convolution properties - 2'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_IGuBPchcQ6w/SqVGxGTYoCI/AAAAAAAAAb4/IIMz7LRQp3M/s72-c/conv_fft.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2204285443084775805</id><published>2009-08-29T11:59:00.008-03:00</published><updated>2009-08-29T12:30:51.202-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='convolution'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Discrete convolution properties - 1</title><content type='html'>I received a comment &lt;a href="http://usingscilab.blogspot.com/2009/08/convolution.html"&gt;here&lt;/a&gt;. And, this post is about discrete convolution properties.&lt;br /&gt;&lt;br /&gt;The continuous form of the convolution is given by:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SplC5Z3wurI/AAAAAAAAAbI/OdDZAQ_NLks/s1600-h/conv.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 59px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/SplC5Z3wurI/AAAAAAAAAbI/OdDZAQ_NLks/s320/conv.png" alt="" id="BLOGGER_PHOTO_ID_5375401184208140978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;So, the discrete form is given by:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SplDw4ngM-I/AAAAAAAAAbQ/kz0M9mkmuy8/s1600-h/discrete_conv.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 78px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SplDw4ngM-I/AAAAAAAAAbQ/kz0M9mkmuy8/s320/discrete_conv.png" alt="" id="BLOGGER_PHOTO_ID_5375402137354253282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;If x[n] and h[n] are limited in the time ({x[n] = 0 if n &lt;&gt; Xn} and {h[n] = 0 if n &lt;&gt; Hn}), then the convolution is implemented as follow:&lt;br /&gt;&lt;br /&gt;Let's suppose Xn &gt; Hn (if Hn &gt; Xn, the analysis is the same).&lt;br /&gt;&lt;br /&gt;The equation is separated in three cases:&lt;br /&gt;&lt;br /&gt;Case 1&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SplFReb-EpI/AAAAAAAAAbY/zNBWiDIZ6c8/s1600-h/discrete_conv-1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 73px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SplFReb-EpI/AAAAAAAAAbY/zNBWiDIZ6c8/s320/discrete_conv-1.png" alt="" id="BLOGGER_PHOTO_ID_5375403796773868178" border="0" /&gt;&lt;/a&gt;Case 2&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SplGtC_NO7I/AAAAAAAAAbg/R3dPSD4RLVM/s1600-h/discrete_conv-2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 53px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/SplGtC_NO7I/AAAAAAAAAbg/R3dPSD4RLVM/s320/discrete_conv-2.png" alt="" id="BLOGGER_PHOTO_ID_5375405369953434546" border="0" /&gt;&lt;/a&gt;Case 3&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/SplHVqwsS9I/AAAAAAAAAbo/pI1fguShGsg/s1600-h/discrete_conv-3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 73px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/SplHVqwsS9I/AAAAAAAAAbo/pI1fguShGsg/s320/discrete_conv-3.png" alt="" id="BLOGGER_PHOTO_ID_5375406067824741330" border="0" /&gt;&lt;/a&gt;Any other situation, y[n] = 0.&lt;br /&gt;&lt;br /&gt;If you make an analysis in y[n], you'll see that y[n] = 0, if n &lt;&gt; Xn + Hn - 1.&lt;br /&gt;&lt;br /&gt;Some other properties of the discrete convolution are the same than the continuous convolution:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;x[n] * h[n] = h[n] * x[n];&lt;/li&gt;&lt;li&gt;x[n]*(h1[n]*h2[n]) = (x[n]*h1[n])*h2[n];&lt;/li&gt;&lt;li&gt;x[n]*(h1[n] + h2[n]) = x[n]*h1[n] + x[n]*h2[n];&lt;/li&gt;&lt;li&gt;a(x[n]*h[n]) = (ax[n])*h[n] = x[n]*(ah[n]), a is real;&lt;/li&gt;&lt;li&gt;x[n]*d[n] = x[n], d[n] = 1 if n = 0 and d[n] = 0 if n is not null;&lt;/li&gt;&lt;li&gt;x[n]*xi[n] = d[n], xi[n] is the inverse of x[n].&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Ok, now you can make your own script for the convolution and try the properties.&lt;br /&gt;&lt;br /&gt;Say me what happens.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2204285443084775805?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2204285443084775805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2204285443084775805&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2204285443084775805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2204285443084775805'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/08/discrete-convolution-properties-1.html' title='Discrete convolution properties - 1'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_IGuBPchcQ6w/SplC5Z3wurI/AAAAAAAAAbI/OdDZAQ_NLks/s72-c/conv.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3257008461174490923</id><published>2009-08-25T14:52:00.004-03:00</published><updated>2009-08-25T15:28:06.574-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='statistic'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Basic statistic</title><content type='html'>Hi Naza, I saw your comment and I'll make your post soon.&lt;br /&gt;&lt;br /&gt;In this post, I want to teach something about basic statistic.&lt;br /&gt;&lt;br /&gt;I recommend the &lt;a href="http://www.amazon.com/Probability-Random-Variables-Stochastic-Processes/dp/0070484775"&gt;Papoulis' book&lt;/a&gt; for who intends to study statistic.&lt;br /&gt;&lt;br /&gt;Here, I'd like to write about random variables and some operations.&lt;br /&gt;&lt;br /&gt;A random variable is a variable that you don't know it value.&lt;br /&gt;&lt;br /&gt;In Scilab, random variables are created by the &lt;span style="font-style: italic;"&gt;rand(.)&lt;/span&gt; function.&lt;br /&gt;&lt;br /&gt;The default distribution of probability used in the &lt;span style="font-style: italic;"&gt;rand(.)&lt;/span&gt; function is &lt;span style="font-style: italic;"&gt;uniform&lt;/span&gt; (between [0, 1]), but the function supports the &lt;span style="font-style: italic;"&gt;normal&lt;/span&gt; distribution (with null mean and unitary variance) too.&lt;br /&gt;&lt;br /&gt;An example:&lt;br /&gt;&lt;br /&gt;x1 = rand()&lt;br /&gt;x1  =&lt;br /&gt;&lt;br /&gt;  0.5608486&lt;br /&gt;&lt;br /&gt;x2 = rand(1, 1, 'uniform') // one line and one column (a scalar variable)&lt;br /&gt;x2  =&lt;br /&gt;&lt;br /&gt;  0.6623569&lt;br /&gt;&lt;br /&gt;x3 = rand(1, 1, 'normal')&lt;br /&gt;x3  =&lt;br /&gt;&lt;br /&gt;  0.6380837&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you have many values in a variable, like this:&lt;br /&gt;&lt;br /&gt;x = rand(10, 1); // ten lines and one column&lt;br /&gt;x  =&lt;br /&gt;&lt;br /&gt;  0.3616361&lt;br /&gt;  0.2922267&lt;br /&gt;  0.5664249&lt;br /&gt;  0.4826472&lt;br /&gt;  0.3321719&lt;br /&gt;  0.5935095&lt;br /&gt;  0.5015342&lt;br /&gt;  0.4368588&lt;br /&gt;  0.2693125&lt;br /&gt;  0.6325745&lt;br /&gt;&lt;br /&gt;then you can see the histogram using the &lt;span style="font-style: italic;"&gt;histplot(.)&lt;/span&gt; function.&lt;br /&gt;&lt;br /&gt;histplot(5, x); // the function takes the biggest and the smallest values, divides the interval in five parts (the number 5, first argument), and counts how many numbers are in each part&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Look the result:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SpQrQEH-JZI/AAAAAAAAAa4/kiB22_OGleo/s1600-h/hist.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 213px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/SpQrQEH-JZI/AAAAAAAAAa4/kiB22_OGleo/s320/hist.gif" alt="" id="BLOGGER_PHOTO_ID_5373967810344920466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now, let's do a smarter example:&lt;br /&gt;&lt;br /&gt;x = rand(10000, 1);&lt;br /&gt;&lt;br /&gt;y = 10*x + 2;&lt;br /&gt;&lt;br /&gt;histplot(20, x);&lt;br /&gt;&lt;br /&gt;scf(); histplot(20, y);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Look the result:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SpQsNyVlv3I/AAAAAAAAAbA/G1g7-ztTPik/s1600-h/hists.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SpQsNyVlv3I/AAAAAAAAAbA/G1g7-ztTPik/s320/hists.png" alt="" id="BLOGGER_PHOTO_ID_5373968870722092914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The graphs look like the same, but if you click over the image then you can see the indexes.&lt;br /&gt;&lt;br /&gt;The left graph (variable x) has the indexes in the interval [0, 1] and the right graph (variable y) has the indexes in the interval [2, 12].&lt;br /&gt;&lt;br /&gt;I ask to my readers: why the indexes are these?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3257008461174490923?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3257008461174490923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3257008461174490923&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3257008461174490923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3257008461174490923'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/08/basic-statistic.html' title='Basic statistic'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_IGuBPchcQ6w/SpQrQEH-JZI/AAAAAAAAAa4/kiB22_OGleo/s72-c/hist.gif' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-66210877998876999</id><published>2009-08-17T10:56:00.003-03:00</published><updated>2009-08-17T11:22:41.687-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='convolution'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Convolution</title><content type='html'>I wrote a post about convolution in my &lt;a href="http://multisign.blogspot.com/2009/03/convolution.html"&gt;other blog&lt;/a&gt;, but I'll write here how to use the convolution in Scilab.&lt;br /&gt;&lt;br /&gt;The convolution is a operation with two functions defined as:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SolkfuWFj-I/AAAAAAAAAao/VvXZssXGxtU/s1600-h/conv.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 59px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SolkfuWFj-I/AAAAAAAAAao/VvXZssXGxtU/s320/conv.png" alt="" id="BLOGGER_PHOTO_ID_5370934526795419618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The function in Scilab that implements the convolution is &lt;span style="font-weight: bold;"&gt;convol(.)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Let's do the test: I'll convolve a cosine (five periods) with itself (one period):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;N1 = 100;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;N2 = 20;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;n1 = 1:N1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;n2 = 1:N2;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;w = %pi/10;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;f1 = cos(w*n1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;f2 = cos(w*n2);&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;y = convol(f1, f2);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;plot(f1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;scf(); plot(f2);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;scf(); plot(y);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/SolmnkB49TI/AAAAAAAAAaw/Y299eA0oSeY/s1600-h/conv_res.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/SolmnkB49TI/AAAAAAAAAaw/Y299eA0oSeY/s320/conv_res.png" alt="" id="BLOGGER_PHOTO_ID_5370936860488561970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The top left graph is &lt;span style="font-weight: bold;"&gt;f1&lt;/span&gt;, the top right is &lt;span style="font-weight: bold;"&gt;f2&lt;/span&gt; and the bottom graph is &lt;span style="font-weight: bold;"&gt;y&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Again, if anyone wants, I can write about discrete convolution properties.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-66210877998876999?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/66210877998876999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=66210877998876999&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/66210877998876999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/66210877998876999'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/08/convolution.html' title='Convolution'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_IGuBPchcQ6w/SolkfuWFj-I/AAAAAAAAAao/VvXZssXGxtU/s72-c/conv.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-10717629602612683</id><published>2009-08-10T10:49:00.003-03:00</published><updated>2009-08-10T11:41:52.882-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><category scheme='http://www.blogger.com/atom/ns#' term='fft'/><title type='text'>FFT - specifying the frequencies</title><content type='html'>I'd like to know my readers, but the "no name" readers deserve respect, as everybody.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://usingscilab.blogspot.com/2009/08/fast-fourier-transform-fft.html"&gt;This post&lt;/a&gt; is about the FFT function, and anyone wants to know how to specify the frequencies for plot the values.&lt;br /&gt;&lt;br /&gt;A few of theory:&lt;br /&gt;&lt;br /&gt;If your signal has N values [0, N - 1], then the Fourier Transform has N distinct values.&lt;br /&gt;&lt;br /&gt;The function fft(.) returns the signal in the interval [0, N - 1], so you can use the function fftshift(.), over the function fft(.) like this: X = fftshift(fft(x)), that it returns the Fourier Transform in the intervals:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;[-(N - 1)/2, (N - 1)/2], if N is odd.&lt;/li&gt;&lt;li&gt;[-N/2, N/2 - 1], if N is even.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;About the frequencies, if your signal was sampled with a rate T (T samples by second), the indexes are given multiplying the interval by: 2*%pi*T.&lt;br /&gt;&lt;br /&gt;Look the example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;N = 100;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;n = 1:N;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;T = 0.1; // one sample by each 0.1s&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;w = 0.5; // frequency of the sampled signal (in radians)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;x = cos(w*n);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;plot(n*T, x); // plot the signal indexed by seconds&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;f = [-N/2:N/2 - 1];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;X = fftshift(fft(x));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;scf();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;plot(f*2*%pi*T, X); // plot the signal indexed by radians&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SoAw7uP4mMI/AAAAAAAAAag/JS1ssBLxmTk/s1600-h/frequencies_correct-fft.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/SoAw7uP4mMI/AAAAAAAAAag/JS1ssBLxmTk/s320/frequencies_correct-fft.png" alt="" id="BLOGGER_PHOTO_ID_5368344558410700994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Observing that w = 0.5 is the frequency of the sampled signal, the true frequency (of the analog source signal) is given by w_source = w/T = 0.5/0.1 = 5 rad/s. Now, click on the image and look where the peaks are.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-10717629602612683?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/10717629602612683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=10717629602612683&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/10717629602612683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/10717629602612683'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/08/fft-specifying-frequencies.html' title='FFT - specifying the frequencies'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_IGuBPchcQ6w/SoAw7uP4mMI/AAAAAAAAAag/JS1ssBLxmTk/s72-c/frequencies_correct-fft.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3326840583900874502</id><published>2009-08-05T09:59:00.003-03:00</published><updated>2009-08-05T12:09:20.903-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Making functions</title><content type='html'>A important resource in any programming language is to make specific functions.&lt;br /&gt;Using Scilab we may make our own functions.&lt;br /&gt;&lt;br /&gt;For example, if we need a function that adds two numbers and divides the result by two, we can call that function as &lt;span style="font-style: italic;"&gt;add_d2(v1, v2)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The follow script is made in the editor.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function [result] = add_d2(v1, v2)&lt;br /&gt; aux = v1 + v2;&lt;br /&gt; result = aux/2;&lt;br /&gt;endfunction;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Or, we can write just one line of code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function [result] = add_d2(v1, v2)&lt;br /&gt; result = (v1 + v2)/2;&lt;br /&gt;endfunction;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Obvious, the example is too simple, but I'd like to give a example for present the syntax.&lt;br /&gt;&lt;br /&gt;Ok, let's make a better example:&lt;br /&gt;&lt;br /&gt;We need a function that finds the peaks in a signal and returns two variable, one with the position and the other with the value of each peak.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function [positions, values] = find_peaks(x)&lt;br /&gt; positions = [];&lt;br /&gt; values = [];&lt;br /&gt;&lt;br /&gt; n_peaks = 0;&lt;br /&gt; for i = 2:length(x) - 1, // x should be a vector, like: x = [x_1 x_2 x_3 ... x_n]&lt;br /&gt;   if (x(i) &gt; x(i - 1)) &amp;amp; (x(i) &gt; x(i + 1)),&lt;br /&gt;     n_peaks = n_peaks + 1;&lt;br /&gt;     positions(n_peaks) = i;&lt;br /&gt;     values(n_peaks) = x(i);&lt;br /&gt;   end;&lt;br /&gt; end;&lt;br /&gt;endfunction;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Test the code and say me what happens.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3326840583900874502?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3326840583900874502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3326840583900874502&amp;isPopup=true' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3326840583900874502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3326840583900874502'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/08/making-functions.html' title='Making functions'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3555774447927864353</id><published>2009-08-01T10:17:00.008-03:00</published><updated>2009-08-01T11:01:14.645-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><category scheme='http://www.blogger.com/atom/ns#' term='fft'/><title type='text'>Fast Fourier Transform - FFT</title><content type='html'>This post is about a good subject in many areas of engineering and informatics: the Fourier Transform. The continuous Fourier Transform is defined as:&lt;br /&gt;&lt;br /&gt;&lt;img src="file:///tmp/moz-screenshot.jpg" alt="" /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SnRD4LVVVwI/AAAAAAAAAaA/MTIe-E4hHAs/s1600-h/fourier.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 274px; height: 89px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SnRD4LVVVwI/AAAAAAAAAaA/MTIe-E4hHAs/s320/fourier.png" alt="" id="BLOGGER_PHOTO_ID_5364987688499107586" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;f(t)&lt;/span&gt; is a continuous function and &lt;span style="font-style: italic;"&gt;F(w)&lt;/span&gt; is the Fourier Transform of &lt;span style="font-style: italic;"&gt;f(t)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;But, the computers don't work with continuous functions, so we should use the discrete form of the Fourier Transform:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SnREAO06MpI/AAAAAAAAAaI/n8MncXQt92A/s1600-h/discret_fourier.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 301px; height: 91px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/SnREAO06MpI/AAAAAAAAAaI/n8MncXQt92A/s320/discret_fourier.png" alt="" id="BLOGGER_PHOTO_ID_5364987826875806354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;f[n]&lt;/span&gt; is a discrete function of &lt;span style="font-style: italic;"&gt;N&lt;/span&gt; elements, &lt;span style="font-style: italic;"&gt;F[p]&lt;/span&gt; is a discrete and periodic function of period &lt;span style="font-style: italic;"&gt;N&lt;/span&gt;, so we calculate just &lt;span style="font-style: italic;"&gt;N&lt;/span&gt; (&lt;span style="font-style: italic;"&gt;0&lt;/span&gt; to &lt;span style="font-style: italic;"&gt;N - 1&lt;/span&gt;) elements for &lt;span style="font-style: italic;"&gt;F[p]&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Who studies digital signal processing or instrumentation and control knows the utilities of this equation.&lt;br /&gt;&lt;br /&gt;Now, how to use the Fourier Transform in Scilab?&lt;br /&gt;&lt;br /&gt;If we are using large signals, like audio files, the discrete Fourier Transform is not a good idea, then we can use the fast Fourier Transform (used with discrete signals), look the script:&lt;br /&gt;&lt;br /&gt;--&gt;N = 100; // number of elements of the signal&lt;br /&gt;&lt;br /&gt;--&gt;n = 0:N - 1;&lt;br /&gt;&lt;br /&gt;--&gt;w1 = %pi/5; // 1st frequency&lt;br /&gt;&lt;br /&gt;--&gt;w2 = %pi/10; // 2nd frequency&lt;br /&gt;&lt;br /&gt;--&gt;s1 = cos(w1*n); // 1st component of the signal&lt;br /&gt;&lt;br /&gt;--&gt;s2 = cos(w2*n); // 2nd component of the signal&lt;br /&gt;&lt;br /&gt;--&gt;f = s1 + s2; // signal&lt;br /&gt;&lt;br /&gt;--&gt;plot(n, f);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SnRHvIfYIGI/AAAAAAAAAaQ/AbauJsDkfZQ/s1600-h/s1_s2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SnRHvIfYIGI/AAAAAAAAAaQ/AbauJsDkfZQ/s320/s1_s2.png" alt="" id="BLOGGER_PHOTO_ID_5364991931163615330" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, let's study the Fourier Transform of our signal.&lt;br /&gt;&lt;br /&gt;--&gt;F = fft(f); // it calculates the Fourier Transform&lt;br /&gt;&lt;br /&gt;--&gt;F_abs = abs(F); // F_abs is the absolute value of each element of F&lt;br /&gt;&lt;br /&gt;--&gt;plot(n, F_abs);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/SnRJTifl24I/AAAAAAAAAaY/23sTWiTxtYs/s1600-h/fft-s1_s2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/SnRJTifl24I/AAAAAAAAAaY/23sTWiTxtYs/s320/fft-s1_s2.png" alt="" id="BLOGGER_PHOTO_ID_5364993656130755458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;" id="result_box" dir="ltr"&gt;Look at the two graph's peaks, one for the component &lt;span style="font-style: italic;"&gt;s1&lt;/span&gt; and the other for the component &lt;span style="font-style: italic;"&gt;s2&lt;/span&gt;.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The Fourier Transform is a linear transformation, thus it has a inverse transformation: the Inverse Fourier Transform.&lt;br /&gt;&lt;br /&gt;Scilab has the function ifft(.) for obtain the original signal from it Fourier Transform.&lt;br /&gt;&lt;br /&gt;If anyone wants to know, I can make a new post about how to identify the frequencies of the original signal in the Fourier Transform.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3555774447927864353?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3555774447927864353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3555774447927864353&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3555774447927864353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3555774447927864353'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/08/fast-fourier-transform-fft.html' title='Fast Fourier Transform - FFT'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_IGuBPchcQ6w/SnRD4LVVVwI/AAAAAAAAAaA/MTIe-E4hHAs/s72-c/fourier.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-7209851617632671750</id><published>2009-07-29T12:22:00.005-03:00</published><updated>2009-07-29T13:00:47.337-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='figure properties'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Color vectors</title><content type='html'>I received a comment (&lt;a href="http://usingscilab.blogspot.com/2009/06/plotting-vectors.html"&gt;here&lt;/a&gt;) asking about color in plotting vectors.&lt;br /&gt;&lt;br /&gt;Ok, I'd not write about properties of figures but the reader's satisfaction is more important.&lt;br /&gt;&lt;br /&gt;We can manipulate any property of the graphs in Scilab as following:&lt;br /&gt;&lt;br /&gt;--&gt; set("figure_style","new"); //create a figure in entity mode&lt;br /&gt;&lt;br /&gt;--&gt;f = get("current_figure")&lt;br /&gt;f  =&lt;br /&gt;&lt;br /&gt;Handle of type "Figure" with properties:&lt;br /&gt;========================================&lt;br /&gt;children: "Axes"&lt;br /&gt;figure_style = "new"&lt;br /&gt;figure_position = [655,473]&lt;br /&gt;figure_size = [610,461]&lt;br /&gt;axes_size = [596,397]&lt;br /&gt;auto_resize = "on"&lt;br /&gt;figure_name = "Scilab Graphic (%d)"&lt;br /&gt;figure_id = 0&lt;br /&gt;color_map= matrix 32x3&lt;br /&gt;pixmap = "off"&lt;br /&gt;pixel_drawing_mode = "copy"&lt;br /&gt;immediate_drawing = "on"&lt;br /&gt;background =  -2&lt;br /&gt;visible = "on"&lt;br /&gt;rotation_style = "unary"&lt;br /&gt;user_data = []&lt;br /&gt;&lt;br /&gt;--&gt; a = f.children // the handle on the Axes child&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, let's set the desired color:&lt;br /&gt;&lt;br /&gt;--&gt; a.foreground = 5;&lt;br /&gt;&lt;br /&gt;And we can make the graph:&lt;br /&gt;&lt;br /&gt;--&gt; x = [1:10]';&lt;br /&gt;&lt;br /&gt;--&gt; y = [1:10]';&lt;br /&gt;&lt;br /&gt;--&gt; [vx vy] = meshgrid(x, y);&lt;br /&gt;&lt;br /&gt;--&gt; champ(x, y, vx, vy, 1);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SnBs0mZjcTI/AAAAAAAAAZI/OqklGN2Quyg/s1600-h/red_vecs.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SnBs0mZjcTI/AAAAAAAAAZI/OqklGN2Quyg/s320/red_vecs.png" alt="" id="BLOGGER_PHOTO_ID_5363906807114985778" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;But, we want more! Let's continue the script as following:&lt;br /&gt;&lt;br /&gt;--&gt; a.foreground = 3;&lt;br /&gt;&lt;br /&gt;--&gt; x = 10 + [1:10]';&lt;br /&gt;&lt;br /&gt;--&gt; y = 10 + [1:10]';&lt;br /&gt;&lt;br /&gt;--&gt; [vx vy] = meshgrid(x, y);&lt;br /&gt;&lt;br /&gt;--&gt; champ(x, y, vx, vy, 1);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SnBtiKD6CLI/AAAAAAAAAZQ/1ltfTqRb7dM/s1600-h/red_green-vecs.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/SnBtiKD6CLI/AAAAAAAAAZQ/1ltfTqRb7dM/s320/red_green-vecs.png" alt="" id="BLOGGER_PHOTO_ID_5363907589781981362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The &lt;span style="font-style: italic;"&gt;foreground&lt;/span&gt; element, called in&lt;br /&gt;&lt;br /&gt;--&gt; a.foreground = n; // n is a number that represents the desired color&lt;br /&gt;&lt;br /&gt;may be any of these values:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;1 - black&lt;/li&gt;&lt;li&gt;2 - blue&lt;/li&gt;&lt;li&gt;3 - green&lt;/li&gt;&lt;li&gt;4 - cyan&lt;/li&gt;&lt;li&gt;5 - red&lt;/li&gt;&lt;li&gt;6 - magenta&lt;/li&gt;&lt;li&gt;7 - yellow&lt;/li&gt;&lt;li&gt;8 - white&lt;/li&gt;&lt;li&gt;9 - dark blue&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Scilab can make graphs with more colors (for the numbers higher or equal than 10), but you are smart for test it.&lt;br /&gt;&lt;br /&gt;If you want a black bound (look that the made graphs, the bound's color is the same of the vectors) you have to put the command&lt;br /&gt;&lt;br /&gt;--&gt; a.foreground = 1;&lt;br /&gt;&lt;br /&gt;after the champ(.) function:&lt;br /&gt;&lt;br /&gt;That's all, now the unknown reader can plot vectors with colors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-7209851617632671750?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/7209851617632671750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=7209851617632671750&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7209851617632671750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/7209851617632671750'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/07/color-vectors.html' title='Color vectors'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_IGuBPchcQ6w/SnBs0mZjcTI/AAAAAAAAAZI/OqklGN2Quyg/s72-c/red_vecs.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-4370274614311285617</id><published>2009-07-22T11:23:00.003-03:00</published><updated>2009-07-22T11:42:45.819-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='lists'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Lists</title><content type='html'>Hi everybody, I couldn't post anything last week because I was in a retreat.&lt;br /&gt;&lt;br /&gt;Let's study something about lists in Scilab now.&lt;br /&gt;&lt;br /&gt;Lists are a type of variables like vectors, but each element may be of any type.&lt;br /&gt;&lt;br /&gt;In vectors, all elements are of the same type (vectors of integers, doubles, strings, etc...).&lt;br /&gt;&lt;br /&gt;In lists, we may have many types of variables.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Creating a list:&lt;br /&gt;&lt;br /&gt;Scilab has a function called list(.) and it may be used with any quantity of elements. Look the examples:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--&gt;person1 = list("Josh", 25, 1.8, 80, "soccer");&lt;br /&gt;&lt;br /&gt;--&gt;person2 = list("Mary", 22, 1.6, 55, "tennis");&lt;br /&gt;&lt;br /&gt;--&gt;person3 = list("Peter", 30, 1.75, 100, "chess");&lt;br /&gt;&lt;br /&gt;--&gt;person1&lt;br /&gt; person1  =&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       person1(1)&lt;br /&gt;&lt;br /&gt; Josh  &lt;br /&gt;&lt;br /&gt;       person1(2)&lt;br /&gt;&lt;br /&gt;    25. &lt;br /&gt;&lt;br /&gt;       person1(3)&lt;br /&gt;&lt;br /&gt;    1.8 &lt;br /&gt;&lt;br /&gt;       person1(4)&lt;br /&gt;&lt;br /&gt;    80. &lt;br /&gt;&lt;br /&gt;       person1(5)&lt;br /&gt;&lt;br /&gt; soccer  &lt;br /&gt;&lt;br /&gt;--&gt;person2&lt;br /&gt; person2  =&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       person2(1)&lt;br /&gt;&lt;br /&gt; Mary  &lt;br /&gt;&lt;br /&gt;       person2(2)&lt;br /&gt;&lt;br /&gt;    22. &lt;br /&gt;&lt;br /&gt;       person2(3)&lt;br /&gt;&lt;br /&gt;    1.6 &lt;br /&gt;&lt;br /&gt;       person2(4)&lt;br /&gt;&lt;br /&gt;    55. &lt;br /&gt;&lt;br /&gt;       person2(5)&lt;br /&gt;&lt;br /&gt; tennis  &lt;br /&gt;&lt;br /&gt;--&gt;person3&lt;br /&gt; person3  =&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       person3(1)&lt;br /&gt;&lt;br /&gt; Peter  &lt;br /&gt;&lt;br /&gt;       person3(2)&lt;br /&gt;&lt;br /&gt;    30. &lt;br /&gt;&lt;br /&gt;       person3(3)&lt;br /&gt;&lt;br /&gt;    1.75 &lt;br /&gt;&lt;br /&gt;       person3(4)&lt;br /&gt;&lt;br /&gt;    100. &lt;br /&gt;&lt;br /&gt;       person3(5)&lt;br /&gt;&lt;br /&gt; chess  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Each person has five informations:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Name&lt;/li&gt;&lt;li&gt;Age&lt;/li&gt;&lt;li&gt;Height&lt;/li&gt;&lt;li&gt;Weight&lt;/li&gt;&lt;li&gt;Favorite sport&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;But, if we want to insert more informations, then we can do:&lt;br /&gt;&lt;br /&gt;--&gt;person1($ + 1) = "male"&lt;br /&gt; person1  =&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       person1(1)&lt;br /&gt;&lt;br /&gt; Josh  &lt;br /&gt;&lt;br /&gt;       person1(2)&lt;br /&gt;&lt;br /&gt;    25. &lt;br /&gt;&lt;br /&gt;       person1(3)&lt;br /&gt;&lt;br /&gt;    1.8 &lt;br /&gt;&lt;br /&gt;       person1(4)&lt;br /&gt;&lt;br /&gt;    80. &lt;br /&gt;&lt;br /&gt;       person1(5)&lt;br /&gt;&lt;br /&gt; soccer  &lt;br /&gt;&lt;br /&gt;       person1(6)&lt;br /&gt;&lt;br /&gt; male  &lt;br /&gt;&lt;br /&gt;--&gt;person2($ + 1) = "female"&lt;br /&gt; person2  =&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       person2(1)&lt;br /&gt;&lt;br /&gt; Mary  &lt;br /&gt;&lt;br /&gt;       person2(2)&lt;br /&gt;&lt;br /&gt;    22. &lt;br /&gt;&lt;br /&gt;       person2(3)&lt;br /&gt;&lt;br /&gt;    1.6 &lt;br /&gt;&lt;br /&gt;       person2(4)&lt;br /&gt;&lt;br /&gt;    55. &lt;br /&gt;&lt;br /&gt;       person2(5)&lt;br /&gt;&lt;br /&gt; tennis  &lt;br /&gt;&lt;br /&gt;       person2(6)&lt;br /&gt;&lt;br /&gt; female  &lt;br /&gt;&lt;br /&gt;--&gt;person3($ + 1) = "male"&lt;br /&gt; person3  =&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       person3(1)&lt;br /&gt;&lt;br /&gt; Peter  &lt;br /&gt;&lt;br /&gt;       person3(2)&lt;br /&gt;&lt;br /&gt;    30. &lt;br /&gt;&lt;br /&gt;       person3(3)&lt;br /&gt;&lt;br /&gt;    1.75 &lt;br /&gt;&lt;br /&gt;       person3(4)&lt;br /&gt;&lt;br /&gt;    100. &lt;br /&gt;&lt;br /&gt;       person3(5)&lt;br /&gt;&lt;br /&gt; chess  &lt;br /&gt;&lt;br /&gt;       person3(6)&lt;br /&gt;&lt;br /&gt; male  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The indexes may be manipulated for insert new elements in any point of the list.&lt;br /&gt;&lt;br /&gt;If anyone has any question about lists (or others subjects), I can try to answer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-4370274614311285617?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/4370274614311285617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=4370274614311285617&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4370274614311285617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4370274614311285617'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/07/lists.html' title='Lists'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-4621018999841408450</id><published>2009-07-07T09:55:00.002-03:00</published><updated>2009-07-07T10:08:32.166-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='videos'/><category scheme='http://www.blogger.com/atom/ns#' term='simulation'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='free software'/><title type='text'>A car and a truck</title><content type='html'>What's the difference between a car and a truck?&lt;br /&gt;&lt;br /&gt;Scilab explains it! Look the Scilab's example video:&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/1GojsPlmPlM&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/1GojsPlmPlM&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Open the window of examples (demonstrations) clicking the &lt;span style="font-weight: bold;"&gt;Demos&lt;/span&gt; button, so you can try all the examples.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-4621018999841408450?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/4621018999841408450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=4621018999841408450&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4621018999841408450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4621018999841408450'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/07/car-and-truck.html' title='A car and a truck'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-4776306639137186545</id><published>2009-06-29T11:29:00.003-03:00</published><updated>2009-07-07T10:08:48.945-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='videos'/><category scheme='http://www.blogger.com/atom/ns#' term='Presentation'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='surfaces'/><title type='text'>Some examples</title><content type='html'>I made a video with some examples.&lt;br /&gt;&lt;br /&gt;Look that the Scilab presents the example's codes.&lt;br /&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/ZSB1vIyJVQg&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/ZSB1vIyJVQg&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;If the readers like my initiative, then I can make more videos.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-4776306639137186545?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/4776306639137186545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=4776306639137186545&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4776306639137186545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4776306639137186545'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/06/some-examples.html' title='Some examples'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-4982110617300270554</id><published>2009-06-26T11:11:00.004-03:00</published><updated>2009-06-26T11:35:00.218-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='polynomials'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Polynomials</title><content type='html'>Let's learn something different today.&lt;br /&gt;&lt;br /&gt;We study polynomials at school, so we are going to learn anything about how Scilab works with them.&lt;br /&gt;&lt;br /&gt;First, this post is moved to fractions of polynomials, for example*:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/SkTY0QaeI_I/AAAAAAAAAYQ/LSJoA39pS4U/s1600-h/frac_poly.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 243px; height: 72px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/SkTY0QaeI_I/AAAAAAAAAYQ/LSJoA39pS4U/s320/frac_poly.png" alt="" id="BLOGGER_PHOTO_ID_5351640649493783538" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;For work with polynomials in Scilab, we use the &lt;span style="font-style: italic;"&gt;%s&lt;/span&gt; as the variable. Look the example**:&lt;br /&gt;&lt;br /&gt;--&gt;A = %s^2 + %s + 1&lt;br /&gt;A  =&lt;br /&gt;&lt;br /&gt;            2&lt;br /&gt;   1 + s + s &lt;br /&gt;&lt;br /&gt;--&gt;B = %s + 2&lt;br /&gt;B  =&lt;br /&gt;&lt;br /&gt;   2 + s &lt;br /&gt;&lt;br /&gt;--&gt;R = A*B&lt;br /&gt;R  =&lt;br /&gt;&lt;br /&gt;              2   3&lt;br /&gt;   2 + 3s + 3s + s &lt;br /&gt;&lt;br /&gt;--&gt;Q = A/B&lt;br /&gt;Q  =&lt;br /&gt;&lt;br /&gt;            2&lt;br /&gt;   1 + s + s &lt;br /&gt;   --------- &lt;br /&gt;     2 + s   &lt;br /&gt;&lt;br /&gt;--&gt;S = A + B&lt;br /&gt;S  =&lt;br /&gt;&lt;br /&gt;             2&lt;br /&gt;   3 + 2s + s &lt;br /&gt;&lt;br /&gt;--&gt;D = A - B&lt;br /&gt;D  =&lt;br /&gt;&lt;br /&gt;        2&lt;br /&gt; - 1 + s &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Observe that Scilab works correctly with the coefficients.&lt;br /&gt;&lt;br /&gt;Now, let's work more, if we have a fraction of polynomials and we need just the denominator:&lt;br /&gt;&lt;br /&gt;--&gt;Q = (%s + 1)/(%s^2 + 2*%s + 2)&lt;br /&gt;Q  =&lt;br /&gt;&lt;br /&gt;     1 + s    &lt;br /&gt;   ---------  &lt;br /&gt;             2&lt;br /&gt;   2 + 2s + s &lt;br /&gt;&lt;br /&gt;--&gt;Dem = denom(Q)&lt;br /&gt;Dem  =&lt;br /&gt;&lt;br /&gt;             2&lt;br /&gt;   2 + 2s + s &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Following with the example, now we need just the numerator:&lt;br /&gt;&lt;br /&gt;--&gt;Num = numer(Q)&lt;br /&gt;Num  =&lt;br /&gt;&lt;br /&gt;   1 + s &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And now, we need the roots of the denominator and of the numerator:&lt;br /&gt;&lt;br /&gt;--&gt;R_Dem = roots(Dem)&lt;br /&gt;R_Dem  =&lt;br /&gt;&lt;br /&gt; - 1. + i  &lt;br /&gt; - 1. - i  &lt;br /&gt;&lt;br /&gt;--&gt;R_Num = roots(Num)&lt;br /&gt;R_Num  =&lt;br /&gt;&lt;br /&gt; - 1.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If anyone has studied linear systems, post a comment here.&lt;br /&gt;If nobody has studied it, you can make a post too.&lt;br /&gt;&lt;br /&gt;-----------------------&lt;br /&gt;* I use &lt;a href="http://www.openoffice.org/product/math.html"&gt;OpenOffice Math&lt;/a&gt; for create the equations.&lt;br /&gt;&lt;br /&gt;** The blog doesn't work with white spaces, but Scilab puts the higher coefficients after.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-4982110617300270554?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/4982110617300270554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=4982110617300270554&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4982110617300270554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4982110617300270554'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/06/polynomials.html' title='Polynomials'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IGuBPchcQ6w/SkTY0QaeI_I/AAAAAAAAAYQ/LSJoA39pS4U/s72-c/frac_poly.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-6506862940745314947</id><published>2009-06-23T14:57:00.004-03:00</published><updated>2009-06-23T15:14:05.447-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='surfaces'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Plot 3D - surface</title><content type='html'>Ok, the world is learning how to use Scilab. I like it a lot!&lt;br /&gt;&lt;br /&gt;Now, let's make surfaces using the function plot3d(.).&lt;br /&gt;&lt;br /&gt;This function is called like this: plot3d(x, y, z);&lt;br /&gt;&lt;br /&gt;Where &lt;span style="font-style: italic;"&gt;x&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;y&lt;/span&gt; are vectors and &lt;span style="font-style: italic;"&gt;z&lt;/span&gt; is a matrix.&lt;br /&gt;&lt;br /&gt;Look the example:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--&gt;d = -3:3;&lt;br /&gt;&lt;br /&gt;--&gt;[x y] = meshgrid(d)&lt;br /&gt;y  =&lt;br /&gt;&lt;br /&gt;- 3.  - 3.  - 3.  - 3.  - 3.  - 3.  - 3.&lt;br /&gt;- 2.  - 2.  - 2.  - 2.  - 2.  - 2.  - 2.&lt;br /&gt;- 1.  - 1.  - 1.  - 1.  - 1.  - 1.  - 1.&lt;br /&gt;  0.    0.    0.    0.    0.    0.    0.&lt;br /&gt;  1.    1.    1.    1.    1.    1.    1.&lt;br /&gt;  2.    2.    2.    2.    2.    2.    2.&lt;br /&gt;  3.    3.    3.    3.    3.    3.    3.&lt;br /&gt;x  =&lt;br /&gt;&lt;br /&gt;- 3.  - 2.  - 1.    0.    1.    2.    3.&lt;br /&gt;- 3.  - 2.  - 1.    0.    1.    2.    3.&lt;br /&gt;- 3.  - 2.  - 1.    0.    1.    2.    3.&lt;br /&gt;- 3.  - 2.  - 1.    0.    1.    2.    3.&lt;br /&gt;- 3.  - 2.  - 1.    0.    1.    2.    3.&lt;br /&gt;- 3.  - 2.  - 1.    0.    1.    2.    3.&lt;br /&gt;- 3.  - 2.  - 1.    0.    1.    2.    3.&lt;br /&gt;&lt;br /&gt;--&gt;z = 9 - (x.^2 + y.^2);&lt;br /&gt;&lt;br /&gt;--&gt;plot3d(d, d, z);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is showed:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SkEZK5JcGjI/AAAAAAAAAYA/6XkeYK1bRtA/s1600-h/surf01.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SkEZK5JcGjI/AAAAAAAAAYA/6XkeYK1bRtA/s320/surf01.png" alt="" id="BLOGGER_PHOTO_ID_5350585507222657586" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The coordinates &lt;span style="font-style: italic;"&gt;x&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;y&lt;/span&gt; were the vector &lt;span style="font-style: italic;"&gt;d&lt;/span&gt; (-3:3).&lt;br /&gt;&lt;br /&gt;We can make any surface, so let's think in other surface. Look the next example:&lt;br /&gt;&lt;br /&gt;--&gt;x = -5:0.1:5;&lt;br /&gt;&lt;br /&gt;--&gt;y = 0:0.1:10;&lt;br /&gt;&lt;br /&gt;--&gt;[xc yc] = meshgrid(x, y);&lt;br /&gt;&lt;br /&gt;--&gt;w = %pi/4;&lt;br /&gt;&lt;br /&gt;--&gt;b = -0.5;&lt;br /&gt;&lt;br /&gt;--&gt;z = exp(b*yc).*sin(w*xc);&lt;br /&gt;&lt;br /&gt;--&gt;plot3d(x, y, z);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SkEbHWqa8oI/AAAAAAAAAYI/wv7ceBYLN7Y/s1600-h/surf02.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SkEbHWqa8oI/AAAAAAAAAYI/wv7ceBYLN7Y/s320/surf02.png" alt="" id="BLOGGER_PHOTO_ID_5350587645449400962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Try to make tests and generate surfaces.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-6506862940745314947?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/6506862940745314947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=6506862940745314947&amp;isPopup=true' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/6506862940745314947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/6506862940745314947'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/06/plot-3d-surface.html' title='Plot 3D - surface'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_IGuBPchcQ6w/SkEZK5JcGjI/AAAAAAAAAYA/6XkeYK1bRtA/s72-c/surf01.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-1657424696481654054</id><published>2009-06-12T10:39:00.004-03:00</published><updated>2009-06-12T10:58:54.797-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Plotting vectors like an animation</title><content type='html'>The &lt;a href="http://usingscilab.blogspot.com/2009/06/plotting-vectors.html"&gt;last post&lt;/a&gt; received a comment, so I thought the readers could like to see anything more about how to plot vectors.&lt;br /&gt;&lt;br /&gt;Let's use the Scilab's text editor, click the 'Editor' button and write the scripts, look the images.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SjJcDbbnFwI/AAAAAAAAAXw/1GwRvVbCN8c/s1600-h/editor.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/SjJcDbbnFwI/AAAAAAAAAXw/1GwRvVbCN8c/s320/editor.png" alt="" id="BLOGGER_PHOTO_ID_5346436921615128322" border="0" /&gt;&lt;/a&gt;Opening the editor.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SjJcbt-JB4I/AAAAAAAAAX4/basPumVpc1k/s1600-h/editing.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SjJcbt-JB4I/AAAAAAAAAX4/basPumVpc1k/s320/editing.png" alt="" id="BLOGGER_PHOTO_ID_5346437338908657538" border="0" /&gt;&lt;/a&gt;Using the editor.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Read the buttons for use the editor's resources.&lt;br /&gt;&lt;br /&gt;Now, let's see what happens when the following script is executed:&lt;br /&gt;&lt;br /&gt;r = 0.1:0.1:10;&lt;br /&gt;&lt;br /&gt;w = %pi/10;&lt;br /&gt;&lt;br /&gt;x_i = 0;&lt;br /&gt;y_i = 0;&lt;br /&gt;for t = 1:length(r),&lt;br /&gt;  x_f = r(t)*cos(w*t);&lt;br /&gt;  y_f = r(t)*sin(w*t);&lt;br /&gt; &lt;br /&gt;  champ(x_i, y_i, x_f - x_i, y_f - y_i, 0.1);&lt;br /&gt; &lt;br /&gt;  x_i = x_f;&lt;br /&gt;  y_i = y_f;&lt;br /&gt; &lt;br /&gt;  sleep(100);&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;--------------&lt;br /&gt;The result:&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/_OSv6yk6dhQ&amp;amp;hl=pt-br&amp;amp;fs=1&amp;amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/_OSv6yk6dhQ&amp;amp;hl=pt-br&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-1657424696481654054?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/1657424696481654054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=1657424696481654054&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1657424696481654054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1657424696481654054'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/06/plotting-vectors-like-animation.html' title='Plotting vectors like an animation'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_IGuBPchcQ6w/SjJcDbbnFwI/AAAAAAAAAXw/1GwRvVbCN8c/s72-c/editor.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-1694994230241385652</id><published>2009-06-05T11:45:00.005-03:00</published><updated>2009-06-05T12:08:24.384-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='statistic'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Plotting vectors</title><content type='html'>I received an e-mail from a reader, I feel happy with it, so if anyone needs help, I'm receiving asks.&lt;br /&gt;&lt;br /&gt;So, let's follow with our Scilab's tutorial.&lt;br /&gt;&lt;br /&gt;This post is about plotting vectors, like the picture.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/Sikw5bthy_I/AAAAAAAAAXg/5t2J8A6GQSA/s1600-h/394px-Vector_field.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 320px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/Sikw5bthy_I/AAAAAAAAAXg/5t2J8A6GQSA/s320/394px-Vector_field.png" alt="" id="BLOGGER_PHOTO_ID_5343856196101196786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;This kind of plotting is very common for applications on electromagnetism or analysis of fluids.&lt;br /&gt;&lt;br /&gt;In Scilab, we can use the champ(.) function for plotting vectors.&lt;br /&gt;&lt;br /&gt;Look the following script:&lt;br /&gt;&lt;br /&gt;--&gt;x = -5:5;                                 &lt;br /&gt;&lt;br /&gt;--&gt;y = 0:4;                                  &lt;br /&gt;&lt;br /&gt;--&gt;[xv yv] = meshgrid(x, y)                  &lt;br /&gt;yv  =&lt;br /&gt;&lt;br /&gt;   0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.&lt;br /&gt;   1.    1.    1.    1.    1.    1.    1.    1.    1.    1.    1.&lt;br /&gt;   2.    2.    2.    2.    2.    2.    2.    2.    2.    2.    2.&lt;br /&gt;   3.    3.    3.    3.    3.    3.    3.    3.    3.    3.    3.&lt;br /&gt;   4.    4.    4.    4.    4.    4.    4.    4.    4.    4.    4.&lt;br /&gt;xv  =&lt;br /&gt;&lt;br /&gt; - 5.  - 4.  - 3.  - 2.  - 1.    0.    1.    2.    3.    4.    5.&lt;br /&gt; - 5.  - 4.  - 3.  - 2.  - 1.    0.    1.    2.    3.    4.    5.&lt;br /&gt; - 5.  - 4.  - 3.  - 2.  - 1.    0.    1.    2.    3.    4.    5.&lt;br /&gt; - 5.  - 4.  - 3.  - 2.  - 1.    0.    1.    2.    3.    4.    5.&lt;br /&gt; - 5.  - 4.  - 3.  - 2.  - 1.    0.    1.    2.    3.    4.    5.&lt;br /&gt;&lt;br /&gt;--&gt;wx = %pi/3;                               &lt;br /&gt;&lt;br /&gt;--&gt;xv = cos(wx*xv);                          &lt;br /&gt;&lt;br /&gt;--&gt;yv = yv/max(yv);                          &lt;br /&gt;&lt;br /&gt;--&gt;champ(x, y, xv', yv', 1);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result is showed following:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/Sikz8HNTTzI/AAAAAAAAAXo/876KmN6CG38/s1600-h/champ.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/Sikz8HNTTzI/AAAAAAAAAXo/876KmN6CG38/s320/champ.png" alt="" id="BLOGGER_PHOTO_ID_5343859540671811378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The champ(.) has five arguments, the first and the second are the coordinates of each vector, the third and the fourth are the components of each vector, and the fifth is a correction argument (for normalization).&lt;br /&gt;&lt;br /&gt;Try to make graphs and say me what happens.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-1694994230241385652?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/1694994230241385652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=1694994230241385652&amp;isPopup=true' title='20 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1694994230241385652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1694994230241385652'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/06/plotting-vectors.html' title='Plotting vectors'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IGuBPchcQ6w/Sikw5bthy_I/AAAAAAAAAXg/5t2J8A6GQSA/s72-c/394px-Vector_field.png' height='72' width='72'/><thr:total>20</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3020564166040432949</id><published>2009-05-26T13:35:00.006-03:00</published><updated>2009-05-26T14:06:01.793-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Making a grid</title><content type='html'>I'm happy with this blog, I received my first comment (&lt;a href="http://usingscilab.blogspot.com/2009/05/simple-graphs-6.html"&gt;here&lt;/a&gt;) this week, thank you Naza Sundae.&lt;br /&gt;&lt;br /&gt;Following with our online Scilab's tutorial, let's learn how to make grids, like the figure:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/ShwcOTBOvZI/AAAAAAAAAXI/BziDCgn51Ls/s1600-h/somlines-after.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 295px; height: 320px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/ShwcOTBOvZI/AAAAAAAAAXI/BziDCgn51Ls/s320/somlines-after.png" alt="" id="BLOGGER_PHOTO_ID_5340174290103745938" border="0" /&gt;&lt;/a&gt;This type of graphs are very important for data visualization.&lt;br /&gt;&lt;br /&gt;The first step is to define each point.&lt;br /&gt;Look the example:&lt;br /&gt;&lt;br /&gt;(1, 5) - (2, 5) - (3, 5) - (4, 5) - (5, 5)&lt;br /&gt;&lt;br /&gt;(1, 4) - (2, 4) - (3, 4) - (4, 4) - (5, 4)&lt;br /&gt;&lt;br /&gt;(1, 3) - (2, 3) - (3, 3) - (4, 3) - (5, 3)&lt;br /&gt;&lt;br /&gt;(1, 2) - (2, 2) - (3, 2) - (4, 2) - (5, 2)&lt;br /&gt;&lt;br /&gt;(1, 1) - (2, 1) - (3, 1) - (4, 1) - (5, 1)&lt;br /&gt;&lt;br /&gt;The x-coordinates are the matrix:&lt;br /&gt;&lt;br /&gt;X = [1, 2, 3, 4, 5;&lt;br /&gt;1, 2, 3, 4, 5;&lt;br /&gt;1, 2, 3, 4, 5;&lt;br /&gt;1, 2, 3, 4, 5;&lt;br /&gt;1, 2, 3, 4, 5]&lt;br /&gt;&lt;br /&gt;And the y-coordinates are the matrix:&lt;br /&gt;&lt;br /&gt;Y = [5, 5, 5, 5, 5;&lt;br /&gt;4, 4, 4, 4, 4;&lt;br /&gt;3, 3, 3, 3, 3;&lt;br /&gt;2, 2, 2, 2, 2;&lt;br /&gt;1, 1, 1, 1, 1]&lt;br /&gt;&lt;br /&gt;So, we can use the meshgrid function, like presented in the following script:&lt;br /&gt;&lt;br /&gt;--&gt;x = meshgrid(1:5)&lt;br /&gt;x  =&lt;br /&gt;&lt;br /&gt; 1.    2.    3.    4.    5.&lt;br /&gt; 1.    2.    3.    4.    5.&lt;br /&gt; 1.    2.    3.    4.    5.&lt;br /&gt; 1.    2.    3.    4.    5.&lt;br /&gt; 1.    2.    3.    4.    5.&lt;br /&gt;&lt;br /&gt;--&gt;y = meshgrid(5:-1:1)'&lt;br /&gt;y  =&lt;br /&gt;&lt;br /&gt; 5.    5.    5.    5.    5.&lt;br /&gt; 4.    4.    4.    4.    4.&lt;br /&gt; 3.    3.    3.    3.    3.&lt;br /&gt; 2.    2.    2.    2.    2.&lt;br /&gt; 1.    1.    1.    1.    1.&lt;br /&gt;&lt;br /&gt;--&gt;plot(x, y, 'k.-');&lt;br /&gt;&lt;br /&gt;--&gt;plot(x', y', 'k.-');&lt;br /&gt;&lt;br /&gt;The result:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/Shwep0378TI/AAAAAAAAAXQ/T7KfbobrL4c/s1600-h/grid01.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/Shwep0378TI/AAAAAAAAAXQ/T7KfbobrL4c/s320/grid01.png" alt="" id="BLOGGER_PHOTO_ID_5340176962071294258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now, I think it's interesting to upgrade our example.&lt;br /&gt;Look the script:&lt;br /&gt;&lt;br /&gt;--&gt;t = 1:20;&lt;br /&gt;&lt;br /&gt;--&gt;x = meshgrid(t);&lt;br /&gt;&lt;br /&gt;--&gt;y = meshgrid(t($:-1:1))';&lt;br /&gt;&lt;br /&gt;--&gt;w = %pi/5;&lt;br /&gt;&lt;br /&gt;--&gt;s = sin(w*x);  &lt;br /&gt;&lt;br /&gt;--&gt;plot(x, s + y, 'b.-');&lt;br /&gt;&lt;br /&gt;--&gt;plot(x', (s + y)', 'b.-');&lt;br /&gt;&lt;br /&gt;The result:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/ShwgygSz6-I/AAAAAAAAAXY/8g4Eu0Bydt4/s1600-h/grid02.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/ShwgygSz6-I/AAAAAAAAAXY/8g4Eu0Bydt4/s320/grid02.png" alt="" id="BLOGGER_PHOTO_ID_5340179310188948450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Try to change the grid and look what happens.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3020564166040432949?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3020564166040432949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3020564166040432949&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3020564166040432949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3020564166040432949'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/05/making-grid.html' title='Making a grid'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IGuBPchcQ6w/ShwcOTBOvZI/AAAAAAAAAXI/BziDCgn51Ls/s72-c/somlines-after.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-8327758981805167797</id><published>2009-05-20T11:21:00.003-03:00</published><updated>2009-05-20T11:46:55.328-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Simple graphs - 6</title><content type='html'>This is the last post about the simple uses of the plot(.) function.&lt;br /&gt;&lt;br /&gt;In this post, we will learn how to mark the points on the line's graphs, like the following figure.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/ShQUU3aNQhI/AAAAAAAAAW4/970qF36Q5js/s1600-h/plot_pts.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 213px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/ShQUU3aNQhI/AAAAAAAAAW4/970qF36Q5js/s320/plot_pts.gif" alt="" id="BLOGGER_PHOTO_ID_5337913807044690450" border="0" /&gt;&lt;/a&gt;The possible styles of markers in Scilab are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Plus sign;&lt;/li&gt;&lt;li&gt;Circle;&lt;/li&gt;&lt;li&gt;Asterisk;&lt;/li&gt;&lt;li&gt;Point;&lt;/li&gt;&lt;li&gt;Cross;&lt;/li&gt;&lt;li&gt;Square;&lt;/li&gt;&lt;li&gt;Diamond;&lt;/li&gt;&lt;li&gt;Upward-pointing triangle;&lt;/li&gt;&lt;li&gt;Downward-pointing triangle;&lt;/li&gt;&lt;li&gt;Rightward-pointing triangle;&lt;/li&gt;&lt;li&gt;Leftward-pointing triangle;&lt;/li&gt;&lt;li&gt;   Five-pointed star (pentagram);&lt;/li&gt;&lt;li&gt;No marker (default).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Those markers may be used with the line's styles (&lt;a href="http://usingscilab.blogspot.com/2009/05/simple-graphs-5.html"&gt;last post&lt;/a&gt;) and the colors (&lt;a href="http://usingscilab.blogspot.com/2009/04/simple-graphs-4.html"&gt;before the last post&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Let's do some examples:&lt;br /&gt;&lt;br /&gt;--&gt;x1 = rand(10, 1);&lt;br /&gt;&lt;br /&gt;--&gt;plot(x1, 'x');&lt;br /&gt;&lt;br /&gt;--&gt;plot(x1, 'o');       &lt;br /&gt;&lt;br /&gt;--&gt;t = 1:10;&lt;br /&gt;&lt;br /&gt;--&gt;x2 = exp(-0.1*t);&lt;br /&gt;&lt;br /&gt;--&gt;scf(); plot(t, x2, 'sr--');&lt;br /&gt;&lt;br /&gt;--&gt;scf(); plot(x1, x2, '^-.g');&lt;br /&gt;&lt;br /&gt;The result:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/ShQXhUjan_I/AAAAAAAAAXA/cJNCbdQgByQ/s1600-h/plots_pts-misc.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/ShQXhUjan_I/AAAAAAAAAXA/cJNCbdQgByQ/s320/plots_pts-misc.png" alt="" id="BLOGGER_PHOTO_ID_5337917319561256946" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Ok, now we are ready for start real applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-8327758981805167797?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/8327758981805167797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=8327758981805167797&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8327758981805167797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8327758981805167797'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/05/simple-graphs-6.html' title='Simple graphs - 6'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_IGuBPchcQ6w/ShQUU3aNQhI/AAAAAAAAAW4/970qF36Q5js/s72-c/plot_pts.gif' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-6878411677380086248</id><published>2009-05-15T11:37:00.003-03:00</published><updated>2009-05-15T11:59:01.292-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Simple graphs - 5</title><content type='html'>Following our studies about the plot(.) function.&lt;br /&gt;&lt;br /&gt;Now, let's learn how to change the line's style.&lt;br /&gt;&lt;br /&gt;The possible line's styles in Scilab are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Solid line (default);&lt;/li&gt;&lt;li&gt;Dashed line;&lt;/li&gt;&lt;li&gt;Dotted line;&lt;/li&gt;&lt;li&gt;Dash-dotted line;&lt;/li&gt;&lt;li&gt;No line.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Each style may be used with the argument color (cited on the &lt;a href="http://usingscilab.blogspot.com/2009/04/simple-graphs-4.html"&gt;last post&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Some examples:&lt;br /&gt;&lt;br /&gt;--&gt;x = 1:10;&lt;br /&gt;&lt;br /&gt;--&gt;y1 = x.^2 + 1;&lt;br /&gt;&lt;br /&gt;--&gt;plot(x, y1, "-");&lt;br /&gt;&lt;br /&gt;--&gt;y2 = x.^2 + 2;&lt;br /&gt;&lt;br /&gt;--&gt;plot(x + 10, y2, "--");&lt;br /&gt;&lt;br /&gt;--&gt;y3 = x.^2 + 3;       &lt;br /&gt;&lt;br /&gt;--&gt;plot(x + 20, y3, ":");&lt;br /&gt;&lt;br /&gt;--&gt;y4 = x.^2 + 4;           &lt;br /&gt;&lt;br /&gt;--&gt;plot(x + 30, y4, "-.");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The result:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/Sg2B0UgdwhI/AAAAAAAAAWw/FGeBP7fPfqg/s1600-h/lines.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/Sg2B0UgdwhI/AAAAAAAAAWw/FGeBP7fPfqg/s320/lines.png" alt="" id="BLOGGER_PHOTO_ID_5336063869361963538" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;You may use the line's styles with colors, for example:&lt;br /&gt;&lt;br /&gt;--&gt; plot(x, y, "r--");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-6878411677380086248?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/6878411677380086248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=6878411677380086248&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/6878411677380086248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/6878411677380086248'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/05/simple-graphs-5.html' title='Simple graphs - 5'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IGuBPchcQ6w/Sg2B0UgdwhI/AAAAAAAAAWw/FGeBP7fPfqg/s72-c/lines.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-8575719528763315637</id><published>2009-04-25T12:40:00.003-03:00</published><updated>2009-04-25T12:59:17.636-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Simple graphs - 4</title><content type='html'>Let's continue our study about the plot(.) function.&lt;br /&gt;&lt;br /&gt;Now, how change the graph's color?&lt;br /&gt;&lt;br /&gt;The plot(.) has a argument that's a string.&lt;br /&gt;&lt;br /&gt;We can do:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;plot(x, y, color);&lt;/li&gt;&lt;li&gt;plot(y, color);&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Remember, when the &lt;span style="font-style: italic;"&gt;x&lt;/span&gt; vector isn't in the function, the default is [1:length(y)], where length(y) is the number of elements that &lt;span style="font-style: italic;"&gt;y&lt;/span&gt; vector has.&lt;br /&gt;&lt;br /&gt;The possible colors are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;red ("r");&lt;/li&gt;&lt;li&gt;green ("g");&lt;br /&gt;&lt;/li&gt;&lt;li&gt;blue ("b");&lt;br /&gt;&lt;/li&gt;&lt;li&gt;cyan ("c");&lt;br /&gt;&lt;/li&gt;&lt;li&gt;magenta ("m");&lt;br /&gt;&lt;/li&gt;&lt;li&gt;yellow ("y");&lt;br /&gt;&lt;/li&gt;&lt;li&gt;black ("k");&lt;br /&gt;&lt;/li&gt;&lt;li&gt;white ("w").&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Let's do an example:&lt;br /&gt;&lt;br /&gt;--&gt;x = [-100:100]';&lt;br /&gt;&lt;br /&gt;--&gt;y1 = abs(x.^3)/1e+5;                     &lt;br /&gt;&lt;br /&gt;--&gt;y2 = x.^3 + x.^2 + 1;                    &lt;br /&gt;&lt;br /&gt;--&gt;y3 = tanh(0.01*x);                       &lt;br /&gt;&lt;br /&gt;--&gt;y2 = y2/max(y2);&lt;br /&gt;&lt;br /&gt;--&gt;plot(x, y1);                             &lt;br /&gt;&lt;br /&gt;--&gt;plot(x, y2, "r");&lt;br /&gt;&lt;br /&gt;--&gt;plot(x, y3, "g");&lt;br /&gt;&lt;br /&gt;--&gt;scf(); plot(x, y2, "k"); plot(x, y3, "y");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This example uses some functions that I had written about, so review the blog if you don't understand anything, or comment here.&lt;br /&gt;&lt;br /&gt;The result is following.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IGuBPchcQ6w/SfMy6M52X_I/AAAAAAAAAWY/IlZUu6vwC4A/s1600-h/color_plot.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://4.bp.blogspot.com/_IGuBPchcQ6w/SfMy6M52X_I/AAAAAAAAAWY/IlZUu6vwC4A/s320/color_plot.png" alt="" id="BLOGGER_PHOTO_ID_5328658759587094514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Look that the default color is blue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-8575719528763315637?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/8575719528763315637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=8575719528763315637&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8575719528763315637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8575719528763315637'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/04/simple-graphs-4.html' title='Simple graphs - 4'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_IGuBPchcQ6w/SfMy6M52X_I/AAAAAAAAAWY/IlZUu6vwC4A/s72-c/color_plot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2216289010561108295</id><published>2009-04-18T12:23:00.004-03:00</published><updated>2009-04-18T12:40:03.949-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Simple graphs - 3</title><content type='html'>I ask excuse me because I was doing other things, like a paper, and I could not post since 4, April.&lt;br /&gt;&lt;br /&gt;Now, I finished the paper, and other things.&lt;br /&gt;&lt;br /&gt;Let's continue talking about the plot(.) function.&lt;br /&gt;&lt;br /&gt;The command for create a new window is scf(), it creates a blank window.&lt;br /&gt;If you have a used window but you want to clear it, so you use the command clf();&lt;br /&gt;&lt;br /&gt;Those commands (scf() and clf()) have no arguments.&lt;br /&gt;&lt;br /&gt;The scf() is utile for show many graphs simultaneously, like the following example.&lt;br /&gt;&lt;br /&gt;The script is following, too:&lt;br /&gt;&lt;br /&gt;--&gt;x = 1:100;&lt;br /&gt;&lt;br /&gt;--&gt;w1 = %pi/3;&lt;br /&gt;&lt;br /&gt;--&gt;y1 = cos(w1*x);&lt;br /&gt;&lt;br /&gt;--&gt;w2 = %pi/7;  &lt;br /&gt;&lt;br /&gt;--&gt;y2 = cos(w2*x);&lt;br /&gt;&lt;br /&gt;--&gt;plot(x, y1);&lt;br /&gt;&lt;br /&gt;--&gt;scf(); plot(x, y2);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SenzbxIqWMI/AAAAAAAAAV8/ho-NN8vq1dM/s1600-h/plot2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/SenzbxIqWMI/AAAAAAAAAV8/ho-NN8vq1dM/s320/plot2.png" alt="" id="BLOGGER_PHOTO_ID_5326055692714006722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The next posts will present how to change the colors and styles of the graphs, and how to put labels on the graphs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2216289010561108295?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2216289010561108295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2216289010561108295&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2216289010561108295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2216289010561108295'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/04/simple-graphs-3.html' title='Simple graphs - 3'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_IGuBPchcQ6w/SenzbxIqWMI/AAAAAAAAAV8/ho-NN8vq1dM/s72-c/plot2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-2044553300756290259</id><published>2009-04-03T14:59:00.004-03:00</published><updated>2009-04-03T15:12:33.903-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='start'/><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Simple graphs - 2</title><content type='html'>In the &lt;a href="http://usingscilab.blogspot.com/2009/03/simple-graphs-1.html"&gt;last post&lt;/a&gt; I introduced the plot(.) function.&lt;br /&gt;&lt;br /&gt;That function is the simplest one for create graphs.&lt;br /&gt;&lt;br /&gt;Let's learn something more about that function.&lt;br /&gt;&lt;br /&gt;Try the commands:&lt;br /&gt;&lt;br /&gt;--&gt;x = rand(10, 1)&lt;br /&gt;x  =&lt;br /&gt;&lt;br /&gt;  0.2113249&lt;br /&gt;  0.7560439&lt;br /&gt;  0.0002211&lt;br /&gt;  0.3303271&lt;br /&gt;  0.6653811&lt;br /&gt;  0.6283918&lt;br /&gt;  0.8497452&lt;br /&gt;  0.6857310&lt;br /&gt;  0.8782165&lt;br /&gt;  0.0683740&lt;br /&gt;&lt;br /&gt;--&gt;plot(x);&lt;br /&gt;&lt;br /&gt;The result is the following picture.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SdZP1kJgVMI/AAAAAAAAAVM/NcSMhyD7zLE/s1600-h/plot1.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 213px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SdZP1kJgVMI/AAAAAAAAAVM/NcSMhyD7zLE/s320/plot1.gif" alt="" id="BLOGGER_PHOTO_ID_5320527791440024770" border="0" /&gt;&lt;/a&gt;Look the indexes (x axis), it starts on 1 and finishes on 10, because we did not put the x axis in the plot(.).&lt;br /&gt;&lt;br /&gt;An other case:&lt;br /&gt;&lt;br /&gt;--&gt;y = rand(10, 1)&lt;br /&gt; y  =&lt;br /&gt;&lt;br /&gt;    0.3076091 &lt;br /&gt;    0.9329616 &lt;br /&gt;    0.2146008 &lt;br /&gt;    0.312642  &lt;br /&gt;    0.3616361 &lt;br /&gt;    0.2922267 &lt;br /&gt;    0.5664249 &lt;br /&gt;    0.4826472 &lt;br /&gt;    0.3321719 &lt;br /&gt;    0.5935095 &lt;br /&gt;&lt;br /&gt;--&gt;x = [0 1 2 3 4 5 6 7 8 9]'&lt;br /&gt; x  =&lt;br /&gt;&lt;br /&gt;    0. &lt;br /&gt;    1. &lt;br /&gt;    2. &lt;br /&gt;    3. &lt;br /&gt;    4. &lt;br /&gt;    5. &lt;br /&gt;    6. &lt;br /&gt;    7. &lt;br /&gt;    8. &lt;br /&gt;    9. &lt;br /&gt;&lt;br /&gt;--&gt;plot(x, y);&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_IGuBPchcQ6w/SdZQww0JmEI/AAAAAAAAAVU/Cvfm89305Ls/s1600-h/plot_xy.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 213px;" src="http://1.bp.blogspot.com/_IGuBPchcQ6w/SdZQww0JmEI/AAAAAAAAAVU/Cvfm89305Ls/s320/plot_xy.gif" alt="" id="BLOGGER_PHOTO_ID_5320528808452397122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now, the x axis starts on 0 and finishes on 9, because I put the coordinates of x axis.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-2044553300756290259?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/2044553300756290259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=2044553300756290259&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2044553300756290259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/2044553300756290259'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/04/simple-graphs-2.html' title='Simple graphs - 2'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_IGuBPchcQ6w/SdZP1kJgVMI/AAAAAAAAAVM/NcSMhyD7zLE/s72-c/plot1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-4064822023734641582</id><published>2009-03-30T17:50:00.005-03:00</published><updated>2009-03-30T18:05:28.666-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Simple graphs - 1</title><content type='html'>This post is about the simplest graphs in Scilab.&lt;br /&gt;&lt;br /&gt;Why do we need to do graphs? I think that's a unnecessary question.&lt;br /&gt;&lt;br /&gt;The Scilab holds the last graph that we do.&lt;br /&gt;&lt;br /&gt;For example, if we need to do two graphs in a same screen, like the following figure.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SdEyU1UEKUI/AAAAAAAAAUU/7NPr1gpvwlk/s1600-h/plot2.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 213px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SdEyU1UEKUI/AAAAAAAAAUU/7NPr1gpvwlk/s320/plot2.gif" alt="" id="BLOGGER_PHOTO_ID_5319087968391276866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Then we need to do the commands:&lt;br /&gt;&lt;br /&gt;--&gt;t = 1:100;&lt;br /&gt;&lt;br /&gt;--&gt;x1 = sin(t*%pi/3);&lt;br /&gt;&lt;br /&gt;--&gt;x2 = 10*exp(-0.1*t).*sin(t*%pi/3);&lt;br /&gt;&lt;br /&gt;--&gt;plot(x1, 'r');&lt;br /&gt;&lt;br /&gt;--&gt;plot(x2);&lt;br /&gt;&lt;br /&gt;The showed graph needs to be saved, so we can click the option export (following figure), after we choose the format and the file's name.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/SdEz5ev5F7I/AAAAAAAAAUc/LyGQJy4HC1s/s1600-h/plot_2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/SdEz5ev5F7I/AAAAAAAAAUc/LyGQJy4HC1s/s320/plot_2.png" alt="" id="BLOGGER_PHOTO_ID_5319089697500764082" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;All ready, the file is saved as a picture!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-4064822023734641582?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/4064822023734641582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=4064822023734641582&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4064822023734641582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/4064822023734641582'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/03/simple-graphs-1.html' title='Simple graphs - 1'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_IGuBPchcQ6w/SdEyU1UEKUI/AAAAAAAAAUU/7NPr1gpvwlk/s72-c/plot2.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-8526879115197894741</id><published>2009-03-19T14:23:00.006-03:00</published><updated>2009-03-19T14:51:41.404-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='files'/><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Using files</title><content type='html'>Scilab has some functions for file manipulating.&lt;br /&gt;&lt;br /&gt;Scilab can work with ASCII or binary files.&lt;br /&gt;&lt;br /&gt;Why do we need to know how to use files?&lt;br /&gt;&lt;br /&gt;If you want to share results, then give files of results is better than give scripts for generate them.&lt;br /&gt;&lt;br /&gt;Okay, I think the most one knows what a file is.&lt;br /&gt;&lt;br /&gt;Let's read the help (click the option like the picture).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/ScKCeYt4r5I/AAAAAAAAAUE/JH6fm2VxAj0/s1600-h/scilab-help.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/ScKCeYt4r5I/AAAAAAAAAUE/JH6fm2VxAj0/s320/scilab-help.png" alt="" id="BLOGGER_PHOTO_ID_5314953968793202578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Write "file manage" and select the first option: &lt;span style="font-style: italic;"&gt;file&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;This function is like the C function fopen().&lt;br /&gt;&lt;br /&gt;The help contains some information over the function.&lt;br /&gt;&lt;br /&gt;We can search for others functions, for example:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;save;&lt;/li&gt;&lt;li&gt;load;&lt;/li&gt;&lt;li&gt;mopen;&lt;/li&gt;&lt;li&gt;mclose;&lt;/li&gt;&lt;li&gt;writeb;&lt;/li&gt;&lt;li&gt;readb.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;But, I don't think these functions very necessary now, maybe in an other situation.&lt;br /&gt;&lt;br /&gt;The most important functions are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;read;&lt;/li&gt;&lt;li&gt;write.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;We create files using &lt;span style="font-style: italic;"&gt;write&lt;/span&gt; and load files using &lt;span style="font-style: italic;"&gt;read&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The functions &lt;span style="font-style: italic;"&gt;read&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;write&lt;/span&gt; are used principally with matrices and vectors.&lt;br /&gt;&lt;br /&gt;Look the examples:&lt;br /&gt;&lt;br /&gt;--&gt;x = rand(5,5)&lt;br /&gt;x  =&lt;br /&gt;&lt;br /&gt;   0.2113249    0.6283918    0.5608486    0.2320748    0.3076091&lt;br /&gt;   0.7560439    0.8497452    0.6623569    0.2312237    0.9329616&lt;br /&gt;   0.0002211    0.6857310    0.7263507    0.2164633    0.2146008&lt;br /&gt;   0.3303271    0.8782165    0.1985144    0.8833888    0.312642 &lt;br /&gt;   0.6653811    0.0683740    0.5442573    0.6525135    0.3616361&lt;br /&gt;&lt;br /&gt;--&gt;write("test_data.dat", x);&lt;br /&gt;&lt;br /&gt;--&gt;y1 = read("test_data.dat", 1, 2) // 1 line and 2 columns&lt;br /&gt;y1  =&lt;br /&gt;&lt;br /&gt;   0.2113249    0.6283918&lt;br /&gt;&lt;br /&gt;--&gt;y2 = read("test_data.dat", 2, 2) // 2 lines and 2 columns&lt;br /&gt;y2  =&lt;br /&gt;&lt;br /&gt;   0.2113249    0.6283918&lt;br /&gt;   0.7560439    0.8497452&lt;br /&gt;&lt;br /&gt;--&gt;y3 = read("test_data.dat", -1, 1) // -1 indicates that "all rows"&lt;br /&gt;y3  =&lt;br /&gt;&lt;br /&gt;   0.2113249&lt;br /&gt;   0.7560439&lt;br /&gt;   0.0002211&lt;br /&gt;   0.3303271&lt;br /&gt;   0.6653811&lt;br /&gt;&lt;br /&gt;--&gt;&gt;y4 = read("test_data.dat", -1, 5) // it reads the full file&lt;br /&gt;y4  =&lt;br /&gt;&lt;br /&gt;   0.2113249    0.6283918    0.5608486    0.2320748    0.3076091&lt;br /&gt;   0.7560439    0.8497452    0.6623569    0.2312237    0.9329616&lt;br /&gt;   0.0002211    0.6857310    0.7263507    0.2164633    0.2146008&lt;br /&gt;   0.3303271    0.8782165    0.1985144    0.8833888    0.312642 &lt;br /&gt;   0.6653811    0.0683740    0.5442573    0.6525135    0.3616361&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The file "test_data.dat" (click on the picture for see the real size):&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IGuBPchcQ6w/ScKFm73iwOI/AAAAAAAAAUM/WKATXYVHq7s/s1600-h/test_data.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://2.bp.blogspot.com/_IGuBPchcQ6w/ScKFm73iwOI/AAAAAAAAAUM/WKATXYVHq7s/s320/test_data.png" alt="" id="BLOGGER_PHOTO_ID_5314957414202786018" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-8526879115197894741?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/8526879115197894741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=8526879115197894741&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8526879115197894741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/8526879115197894741'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/03/using-files.html' title='Using files'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IGuBPchcQ6w/ScKCeYt4r5I/AAAAAAAAAUE/JH6fm2VxAj0/s72-c/scilab-help.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-525834927500237152</id><published>2009-03-11T17:32:00.002-03:00</published><updated>2009-03-11T17:50:19.671-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='logic operations'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Operations element by element</title><content type='html'>I was wrong, this post will talk about matrices and vectors (yet).&lt;br /&gt;&lt;br /&gt;Let's talk about operations element by element.&lt;br /&gt;&lt;br /&gt;For example, we have two matrices of same size and we need to multiply and to divide each element:&lt;br /&gt;&lt;br /&gt;X = [x11 x12 x13;&lt;br /&gt;x21 x22 x23;&lt;br /&gt;x31 x32 x33].&lt;br /&gt;&lt;br /&gt;Y = [y11 y12 y13;&lt;br /&gt;y21 y22 y23;&lt;br /&gt;y31 y32 y33].&lt;br /&gt;&lt;br /&gt;Z1 = [x11*y11 x12*y12 x13*y13;&lt;br /&gt;x21*y21 x22*y22 x23*y23;&lt;br /&gt;x31*y31 x32*y32 x33*y33].&lt;br /&gt;&lt;br /&gt;Z2 = [x11/y11 x12/y12 x13/y13;&lt;br /&gt;x21/y21 x22/y22 x23/y23;&lt;br /&gt;x31/y31 x32/y32 x33/y33].&lt;br /&gt;&lt;br /&gt;The math doesn't have a operation for it, but it's possible using Scilab.&lt;br /&gt;&lt;br /&gt;--&gt;X = zeros(3,3);&lt;br /&gt;&lt;br /&gt;--&gt;X(:) = [1:9]'&lt;br /&gt; X  =&lt;br /&gt;&lt;br /&gt;    1.    4.    7. &lt;br /&gt;    2.    5.    8. &lt;br /&gt;    3.    6.    9. &lt;br /&gt;&lt;br /&gt;--&gt;Y = ones(3,3) + X'&lt;br /&gt; Y  =&lt;br /&gt;&lt;br /&gt;    2.    3.    4.  &lt;br /&gt;    5.    6.    7.  &lt;br /&gt;    8.    9.    10. &lt;br /&gt;&lt;br /&gt;--&gt;Z1 = X.*Y&lt;br /&gt; Z1  =&lt;br /&gt;&lt;br /&gt;    2.     12.    28. &lt;br /&gt;    10.    30.    56. &lt;br /&gt;    24.    54.    90. &lt;br /&gt;&lt;br /&gt;--&gt;Z1 = X./Y&lt;br /&gt; Z1  =&lt;br /&gt;&lt;br /&gt;    0.5      1.3333333    1.75      &lt;br /&gt;    0.4      0.8333333    1.1428571 &lt;br /&gt;    0.375    0.6666667    0.9&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The operations sum and subtraction work element by element, like in matrices sum and subtraction.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Logic operations&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;If we need to use logic operations then we can use the operators:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&amp;amp; - AND;&lt;/li&gt;&lt;li&gt;| - OR;&lt;/li&gt;&lt;li&gt;~ - NOT.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;--&gt;X = rand(3,3) &gt; 0.2&lt;br /&gt; X  =&lt;br /&gt;&lt;br /&gt;  F T T &lt;br /&gt;  T F T &lt;br /&gt;  T T T&lt;br /&gt;&lt;br /&gt;--&gt;Y = rand(3,3,'normal') &gt; 0.5&lt;br /&gt; Y  =&lt;br /&gt;&lt;br /&gt;  T T F &lt;br /&gt;  T F T &lt;br /&gt;  F F F&lt;br /&gt;&lt;br /&gt;--&gt;Z1 = X &amp;amp; Y&lt;br /&gt; Z1  =&lt;br /&gt;&lt;br /&gt;  F T F &lt;br /&gt;  T F T &lt;br /&gt;  F F F &lt;br /&gt;&lt;br /&gt;--&gt;Z2 = X | Y&lt;br /&gt; Z2  =&lt;br /&gt;&lt;br /&gt;  T T T &lt;br /&gt;  T F T &lt;br /&gt;  T T T &lt;br /&gt;&lt;br /&gt;--&gt;Z3 = ~X  &lt;br /&gt; Z3  =&lt;br /&gt;&lt;br /&gt;  T F F &lt;br /&gt;  F T F &lt;br /&gt;  F F F &lt;br /&gt;&lt;br /&gt;--&gt;Z4 = (~X) | Y&lt;br /&gt; Z4  =&lt;br /&gt;&lt;br /&gt;  T T F &lt;br /&gt;  T T T &lt;br /&gt;  F F F&lt;br /&gt;&lt;br /&gt;That's all, I'm thinking about the next subject that I'll talk here. I accept suggestions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-525834927500237152?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/525834927500237152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=525834927500237152&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/525834927500237152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/525834927500237152'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/03/operations-element-by-element.html' title='Operations element by element'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-1024154970372226533</id><published>2009-03-03T22:11:00.003-03:00</published><updated>2009-03-03T22:28:52.631-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='statistic'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='logic operations'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Vectors and Matrices - 4</title><content type='html'>I think this is the last basic post about vectors and matrices.&lt;br /&gt;&lt;br /&gt;Let's do logic operations with vectors and matrices.&lt;br /&gt;&lt;br /&gt;Our example uses more common informations.&lt;br /&gt;&lt;br /&gt;We have a vector and each element is the height of a person (in meters).&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;v = [1.55 1.82 1.48 1.71 1.62 1.94 2.00]'&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now, we need to know who is taller than 1.80m.&lt;br /&gt;&lt;br /&gt;So, we can do an analysis element by element, like this:&lt;br /&gt;&lt;br /&gt;v(1) &gt; 1.80&lt;br /&gt;v(2) &gt; 1.80&lt;br /&gt;v(3) &gt; 1.80&lt;br /&gt;v(4) &gt; 1.80&lt;br /&gt;v(5) &gt; 1.80&lt;br /&gt;v(6) &gt; 1.80&lt;br /&gt;v(7) &gt; 1.80&lt;br /&gt;&lt;br /&gt;But, the Scilab has a very simple solution.&lt;br /&gt;&lt;br /&gt;v &gt; 1.8 // this operation is non-dependent of vector's dimensionality&lt;br /&gt;&lt;br /&gt;Look the script.&lt;br /&gt;&lt;br /&gt;--&gt;v = [1.55 1.82 1.48 1.71 1.62 1.94 2.00]'&lt;br /&gt; v  =&lt;br /&gt;&lt;br /&gt;    1.55 &lt;br /&gt;    1.82 &lt;br /&gt;    1.48 &lt;br /&gt;    1.71 &lt;br /&gt;    1.62 &lt;br /&gt;    1.94 &lt;br /&gt;    2.   &lt;br /&gt;&lt;br /&gt;--&gt;v &gt; 1.8&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  F &lt;br /&gt;  T &lt;br /&gt;  F &lt;br /&gt;  F &lt;br /&gt;  F &lt;br /&gt;  T &lt;br /&gt;  T&lt;br /&gt;&lt;br /&gt;But, if we want the positions of the elements (people) taller than 1.80m then we can do this:&lt;br /&gt;&lt;br /&gt;--&gt;positions = find(v &gt; 1.8)&lt;br /&gt; positions  =&lt;br /&gt;&lt;br /&gt;    2.    6.    7.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The elements in v these are taller than 1.8m are the 2nd (1.82m), 6th (1.94m) and 7th (2.00m).&lt;br /&gt;&lt;br /&gt;We can do the same analysis for matrices.&lt;br /&gt;&lt;br /&gt;A very useful example is a binary matrix with equal probability of zeros and ones.&lt;br /&gt;&lt;br /&gt;Look the script and post to me your comments.&lt;br /&gt;&lt;br /&gt;--&gt;x = rand(3, 3) &lt;br /&gt; x  =&lt;br /&gt;&lt;br /&gt;    0.5667211    0.0568928    0.7279222 &lt;br /&gt;    0.5711639    0.5595937    0.2677766 &lt;br /&gt;    0.8160110    0.1249340    0.5465335 &lt;br /&gt;&lt;br /&gt;--&gt;y = x &gt; 0.5&lt;br /&gt; y  =&lt;br /&gt;&lt;br /&gt;  T F T &lt;br /&gt;  T T F &lt;br /&gt;  T F T&lt;br /&gt;&lt;br /&gt;In showed example we have more ones ("Trues"), I ask: why?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-1024154970372226533?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/1024154970372226533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=1024154970372226533&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1024154970372226533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/1024154970372226533'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/03/vectors-and-matrices-4.html' title='Vectors and Matrices - 4'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-6892711746175483946</id><published>2009-02-27T10:48:00.003-03:00</published><updated>2009-02-27T11:25:13.500-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='logic operations'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Logic Operations</title><content type='html'>I think the most one knows something about logic operations, but let's do a little review.&lt;br /&gt;&lt;br /&gt;Logic operations are used for analysis of situations like:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;2 is bigger than 3? - false&lt;/li&gt;&lt;li&gt;the vector [1 2 3 4] is larger than [1 3 5]? - true&lt;/li&gt;&lt;li&gt;the word 'horse' is smaller than 'dog'? - false&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The logic operations combine two or more situations, for example:&lt;br /&gt;&lt;br /&gt;I'm 22, my father's 52 and my sister's 19.&lt;br /&gt;&lt;br /&gt;The question: who is the older?&lt;br /&gt;&lt;br /&gt;The solution:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;if I'm older than my father &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; my sister then I'm the older.&lt;/li&gt;&lt;li&gt;if my father's older than me &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; my sister then he's the older.&lt;/li&gt;&lt;li&gt;if my sister's older than my father &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; me then she's the older.&lt;/li&gt;&lt;/ul&gt;The &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; is a logic operator.&lt;br /&gt;&lt;br /&gt;The logic operators are used with logic variables. Logic variables are like numeric variables but the values are &lt;span style="font-weight: bold;"&gt;true&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;false&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The basic logic operators are: {&lt;span style="font-weight: bold;"&gt;not&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;or&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; is a unary operator and the others are binary operators.&lt;br /&gt;&lt;br /&gt;So, follow the possible logic situations for each operation:&lt;br /&gt;&lt;br /&gt;NOT&lt;br /&gt;&lt;ul&gt;&lt;li&gt;not(true) is false&lt;/li&gt;&lt;li&gt;not(false) is true&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;AND&lt;br /&gt;&lt;ul&gt;&lt;li&gt;false and false is false&lt;/li&gt;&lt;li&gt;false and true is false&lt;/li&gt;&lt;li&gt;true and false is false&lt;/li&gt;&lt;li&gt;true and true is true&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;OR&lt;br /&gt;&lt;ul&gt;&lt;li&gt;false or false is false&lt;/li&gt;&lt;li&gt; false or true is true&lt;/li&gt;&lt;li&gt; true or false is true&lt;/li&gt;&lt;li&gt; true or true is true&lt;/li&gt;&lt;/ul&gt;   &lt;br /&gt;A mental train.&lt;br /&gt;&lt;br /&gt;If I want a racket and a ball but I have just a racket I'm not satisfied. But, If I want a ball of basketball or a ball of soccer, so I need one ball or both.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Scilab has that three operators.&lt;br /&gt;&lt;br /&gt;The operator '~' is the &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The operator '|' is the &lt;span style="font-weight: bold;"&gt;or&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The operator '&amp;amp;' is the &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The operations &lt;span style="font-weight: bold;"&gt;or&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; can be applied on vectors with the functions &lt;span style="font-weight: bold;"&gt;or(.)&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;and(.)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Let's play now.&lt;br /&gt;&lt;br /&gt;--&gt;x = 10;&lt;br /&gt;&lt;br /&gt;--&gt;y = 15;&lt;br /&gt;&lt;br /&gt;--&gt;z = x + y&lt;br /&gt; z  =&lt;br /&gt;&lt;br /&gt;    25. &lt;br /&gt;&lt;br /&gt;--&gt;(x &gt; y) &amp;amp; (z &gt; x) // x is smaller than y then the first operation is false&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  F &lt;br /&gt;&lt;br /&gt;--&gt;(x &gt; y) | (z &gt; x) // z is bigger than x then the second operation is true&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  T &lt;br /&gt;&lt;br /&gt;--&gt;~((x &gt; y) &amp;amp; (z &gt; x)) // the result is the inverse of the first result&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  T &lt;br /&gt;&lt;br /&gt;--&gt;~((x &gt; y) | (z &gt; x)) // the result is the inverse of the second result&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  F &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The results are F (false) or T (true) because logic operations give logic results.&lt;br /&gt;&lt;br /&gt;If you want use the variables with logic values:&lt;br /&gt;&lt;br /&gt;--&gt;r1 = %F&lt;br /&gt; r1  =&lt;br /&gt;&lt;br /&gt;  F &lt;br /&gt;&lt;br /&gt;--&gt;r2 = %T&lt;br /&gt; r2  =&lt;br /&gt;&lt;br /&gt;  T &lt;br /&gt;&lt;br /&gt;--&gt;and([r1 r2])&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  F &lt;br /&gt;&lt;br /&gt;--&gt;or([r1 r2])&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  T&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For finish the post, if you use a numeric variable with logic operators, thus the Scilab interprets the 0 (zero) as false and different of 0 (zero) as true.&lt;br /&gt;&lt;br /&gt;--&gt;x = 0;&lt;br /&gt;&lt;br /&gt;--&gt;y = 2;&lt;br /&gt;&lt;br /&gt;--&gt;z = -5;&lt;br /&gt;&lt;br /&gt;--&gt;x | y | z&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  T &lt;br /&gt;&lt;br /&gt;--&gt;x &amp;amp; y &amp;amp; z&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  F &lt;br /&gt;&lt;br /&gt;--&gt;x &amp;amp; z   &lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  F &lt;br /&gt;&lt;br /&gt;--&gt;x &amp;amp; y&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  F &lt;br /&gt;&lt;br /&gt;--&gt;y &amp;amp; z&lt;br /&gt; ans  =&lt;br /&gt;&lt;br /&gt;  T&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-6892711746175483946?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/6892711746175483946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=6892711746175483946&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/6892711746175483946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/6892711746175483946'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/02/logic-operations.html' title='Logic Operations'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3068212905898341704</id><published>2009-02-11T10:45:00.005-03:00</published><updated>2009-02-19T14:05:29.553-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Vectors and Matrices - 3</title><content type='html'>Now, I'll write about specific functions for matrices.&lt;br /&gt;&lt;br /&gt;The most common functions that I use:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;eye(m,n) - identity matrix;&lt;/li&gt;&lt;li&gt;zeros(m,n) - matrix of zeros;&lt;/li&gt;&lt;li&gt;ones(m,n) - matrix of ones;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;det(X) - determinant;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;inv(X) - matrix inverse;&lt;/li&gt;&lt;li&gt;pinv(A,[tol]) - pseudoinverse;&lt;/li&gt;&lt;li&gt;sum(x,[key]) - sum (row sum, column sum) of vector/matrix entries;&lt;/li&gt;&lt;li&gt;prod(x,[key]) - product (row sum, column sum) of vector/matrix entries;&lt;/li&gt;&lt;li&gt;mean(x,[key]) - mean (row sum, column sum) of vector/matrix entries;&lt;/li&gt;&lt;li&gt;stdev(x,[key]) - standard deviation (row sum, column sum) of vector/matrix entries;&lt;/li&gt;&lt;li&gt;geomean(x,[key]) - geometric mean (row sum, column sum) of vector/matrix entries;&lt;/li&gt;&lt;li&gt;harmean(x,[key]) - harmonic mean (row sum, column sum) of vector/matrix entries;&lt;/li&gt;&lt;li&gt;msd(x,[key]) - mean squared deviation (row sum, column sum) of vector/matrix entries;&lt;/li&gt;&lt;li&gt;rand(m1,m2,.. [,key]) - random number generator;&lt;/li&gt;&lt;li&gt;grand(m, n, dist_type [,p1,...,pk]) - Random number generator(s);&lt;/li&gt;&lt;li&gt;find(X) - find indices of boolean vector or matrix true elements.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Each function has it own purpose.&lt;br /&gt;&lt;br /&gt;Let's play, with them.&lt;br /&gt;&lt;br /&gt;--&gt;eye(3,3) // identity matrix 3 lines and 3 columns*&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;  1.    0.    0.&lt;br /&gt;  0.    1.    0.&lt;br /&gt;  0.    0.    1.&lt;br /&gt;&lt;br /&gt;--&gt;rand(5,2) // matrix (5 lines and 2 columns) of random numbers with uniform probability distribution between [0,1]&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;  0.0683740    0.5442573&lt;br /&gt;  0.5608486    0.2320748&lt;br /&gt;  0.6623569    0.2312237&lt;br /&gt;  0.7263507    0.2164633&lt;br /&gt;  0.1985144    0.8833888&lt;br /&gt;&lt;br /&gt;--&gt;rand(2,5,'normal') // matrix (2 lines and 5 columns) of random numbers with normal (Gaussian) distribution (mean = 0 and variance = 1)&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;  1.0478272  - 1.4061926  - 1.7350313  - 0.2143931    2.5891773&lt;br /&gt;- 1.3218008  - 1.0384734    0.5546874  - 2.0735088    0.0424792&lt;br /&gt;&lt;br /&gt;--&gt;det(eye(4,4)) // determinant of identity matrix 4 x 4&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;  1.&lt;br /&gt;&lt;br /&gt;--&gt;X = rand(5,5) // X is a matrix (5 x 5) with random values between [0,1]&lt;br /&gt;X  =&lt;br /&gt;&lt;br /&gt;  0.4368588    0.0437334    0.1280058    0.1531217    0.8784126&lt;br /&gt;  0.2693125    0.4818509    0.7783129    0.6970851    0.1138360&lt;br /&gt;  0.6325745    0.2639556    0.2119030    0.8415518    0.1998338&lt;br /&gt;  0.4051954    0.4148104    0.1121355    0.4062025    0.5618661&lt;br /&gt;  0.9184708    0.2806498    0.6856896    0.4094825    0.5896177&lt;br /&gt;&lt;br /&gt;--&gt;det_X = det(X) // det_X is the determinant of X&lt;br /&gt;det_X  =&lt;br /&gt;&lt;br /&gt;- 0.0799884&lt;br /&gt;&lt;br /&gt;--&gt;[py px] = find(eye(3,3)) // px is the positions (x-coordinates) of numbers nonzeros and py is the positions (y-coordinates) of numbers nonzeros&lt;br /&gt;px  =&lt;br /&gt;&lt;br /&gt;  1.    2.    3.&lt;br /&gt;py  =&lt;br /&gt;&lt;br /&gt;  1.    2.    3.&lt;br /&gt;&lt;br /&gt;--&gt;[py px] = find(~eye(3,3)) // the ~ is the logic negative operation, so (~0) = 1 and (~1) = 0**&lt;br /&gt;px  =&lt;br /&gt;&lt;br /&gt;  1.    1.    2.    2.    3.    3.&lt;br /&gt;py  =&lt;br /&gt;&lt;br /&gt;  2.    3.    1.    3.    1.    2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--&gt;X // the variable X (X = rand(5,5))&lt;br /&gt;X  =&lt;br /&gt;&lt;br /&gt;  0.4368588    0.0437334    0.1280058    0.1531217    0.8784126&lt;br /&gt;  0.2693125    0.4818509    0.7783129    0.6970851    0.1138360&lt;br /&gt;  0.6325745    0.2639556    0.2119030    0.8415518    0.1998338&lt;br /&gt;  0.4051954    0.4148104    0.1121355    0.4062025    0.5618661&lt;br /&gt;  0.9184708    0.2806498    0.6856896    0.4094825    0.5896177&lt;br /&gt;&lt;br /&gt;--&gt;sum(X,'r') // sum over the columns of X (row of values)&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;  2.6624119    1.4850001    1.9160468    2.5074436    2.3435661&lt;br /&gt;&lt;br /&gt;--&gt;sum(X,'c') // sum over the lines of X (column of values)&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;  1.6401323&lt;br /&gt;  2.3403973&lt;br /&gt;  2.1498187&lt;br /&gt;  1.9002098&lt;br /&gt;  2.8839105&lt;br /&gt;&lt;br /&gt;--&gt;sum(X) // sum of all elements of X&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;  10.914469&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, if anyone has any question, then everyone can do comments.&lt;br /&gt;&lt;br /&gt;----------&lt;br /&gt;&lt;br /&gt;* If you do a command without send the return to a variable, then the Scilab creates the variable &lt;span style="font-style: italic;"&gt;ans&lt;/span&gt; (answer) with the return or function or operation.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;--&gt;1+1&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;  2.&lt;br /&gt;&lt;br /&gt;--&gt;cos(%pi)&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;- 1.&lt;br /&gt;&lt;br /&gt;--&gt;sin(%pi/2)+1&lt;br /&gt;ans  =&lt;br /&gt;&lt;br /&gt;  2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;** I'll write about logic operations in next posts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3068212905898341704?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3068212905898341704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3068212905898341704&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3068212905898341704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3068212905898341704'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/02/vectors-and-matrices-3.html' title='Vectors and Matrices - 3'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3706573088725117536</id><published>2009-02-07T10:45:00.000-03:00</published><updated>2009-02-07T11:32:04.978-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><category scheme='http://www.blogger.com/atom/ns#' term='functions'/><title type='text'>Vectors and Matrices - 2</title><content type='html'>In the last post, I wrote about simple operations with matrices. Now, I want to talk about the functions and we will use them on matrices and vectors.&lt;br /&gt;&lt;br /&gt;All right, let's start. The Scilab has many math functions, like sin, cos, tan, asin, acos, atan, exp, log, etc....&lt;br /&gt;&lt;br /&gt;All functions can be used on any type of numeric variable (scalar, vector, matrix or tensor).&lt;br /&gt;&lt;br /&gt;First example:&lt;br /&gt;--&gt;x = [1 0 1;&lt;br /&gt;--&gt;0 1 0;&lt;br /&gt;--&gt;1 0 1]&lt;br /&gt;x  =&lt;br /&gt;&lt;br /&gt;   1.    0.    1.&lt;br /&gt;   0.    1.    0.&lt;br /&gt;   1.    0.    1.&lt;br /&gt;&lt;br /&gt;--&gt;y = cos(%pi*x) // the Scilab has some common values, I know PI (%pi = 3.1415927) and E (%e = 2.7182818)&lt;br /&gt;y  =&lt;br /&gt;&lt;br /&gt; - 1.    1.  - 1.&lt;br /&gt;   1.  - 1.    1.&lt;br /&gt; - 1.    1.  - 1.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Look that cos(%pi) = -1 and cos(0) = 1 (remember the trigonometric circle).&lt;br /&gt;&lt;br /&gt;So, operations with matrices create new matrices, and the new matrices can be used on the new operations or functions.&lt;br /&gt;&lt;br /&gt;Let's go to the second example.&lt;br /&gt;--&gt;x = [1 2 3]&lt;br /&gt;x  =&lt;br /&gt;&lt;br /&gt;   1.    2.    3.&lt;br /&gt;&lt;br /&gt;--&gt;y = [3;&lt;br /&gt;--&gt;2;&lt;br /&gt;--&gt;1]&lt;br /&gt;y  =&lt;br /&gt;&lt;br /&gt;   3.&lt;br /&gt;   2.&lt;br /&gt;   1.&lt;br /&gt;&lt;br /&gt;--&gt;z1 = exp(x*y)&lt;br /&gt;z1  =&lt;br /&gt;&lt;br /&gt;   22026.466&lt;br /&gt;&lt;br /&gt;--&gt;z2 = exp(y*x)&lt;br /&gt;z2  =&lt;br /&gt;&lt;br /&gt;   20.085537    403.42879    8103.0839&lt;br /&gt;   7.3890561    54.59815     403.42879&lt;br /&gt;   2.7182818    7.3890561    20.085537&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The operation x*y results in&lt;br /&gt;x*y = [1*3 + 2*2 + 3*1] = [3 + 4 + 3] = 10.&lt;br /&gt;The operation y*x results in&lt;br /&gt;y*x =&lt;br /&gt;[3*1 3*2 3*3;&lt;br /&gt;2*1 2*2 2*3;&lt;br /&gt;1*1 1*2 1*3] =&lt;br /&gt;[3 6 9;&lt;br /&gt;2 4 6;&lt;br /&gt;1 2 3].&lt;br /&gt;&lt;br /&gt;The function exp(.) returns the natural exponential (exp(x) = %e^x).&lt;br /&gt;&lt;br /&gt;Ok, let's finish here. Who wants more, do comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3706573088725117536?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3706573088725117536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3706573088725117536&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3706573088725117536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3706573088725117536'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/02/vectors-and-matrices-2.html' title='Vectors and Matrices - 2'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3054821536810158502</id><published>2009-01-31T08:59:00.000-03:00</published><updated>2009-01-31T09:32:23.944-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vector'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><title type='text'>Vectors and Matrices - 1</title><content type='html'>The Scilab is like Matlab (Matrix Lab), I don't like Matlab but it's other thing.&lt;br /&gt;&lt;br /&gt;The Scilab was created for matrix manipulation, so it can operate matrices (and similars) naturally.&lt;br /&gt;&lt;br /&gt;This is the first post about vectors and matrices.&lt;br /&gt;&lt;br /&gt;Let's do something.&lt;br /&gt;&lt;br /&gt;Get a vector&lt;br /&gt;x = [1 2 3 4]' (x is a column vector)&lt;br /&gt;and a matrix&lt;br /&gt;A = [1 2 3 4;&lt;br /&gt;        1 2 3 4;&lt;br /&gt;        1 2 3 4;&lt;br /&gt;        1 2 3 4].&lt;br /&gt;&lt;br /&gt;If y = A x (matrix multiplication), then y = [x[1]A[1,1]+x[2]A[2,1]+x[3]A[3,1]+x[4]A[4,1] x[1]A[1,2]+x[2]A[2,2]+x[3]A[3,2]+x[4]A[4,2] x[1]A[1,3]+x[2]A[2,3]+x[3]A[3,3]+x[4]A[4,3] x[1]A[1,4]+x[2]A[2,4]+x[3]A[3,4]+x[4]A[4,4]] = [1²+2²+3²+4² 1²+2²+3²+4² 1²+2²+3²+4² 1²+2²+3²+4²] = [30 30 30 30].&lt;br /&gt;&lt;br /&gt;For who studies linear algebra, the equation y = A x is a generic linear system of 1st order.&lt;br /&gt;&lt;br /&gt;Using Scilab, we can do the commands.&lt;br /&gt;&lt;br /&gt;--&gt;x = [1 2 3 4]'; // the apostrophe { ' } indicates the transposition, so x is a column vector because [1 2 3 4] is a line vector and x is [1 2 3 4] transpose.&lt;br /&gt;&lt;br /&gt;--&gt;A = [1 2 3 4;&lt;br /&gt;--&gt;1 2 3 4;&lt;br /&gt;--&gt;1 2 3 4;&lt;br /&gt;--&gt;1 2 3 4];&lt;br /&gt;&lt;br /&gt;--&gt;y = A*x&lt;br /&gt; y  =&lt;br /&gt;&lt;br /&gt;    30. &lt;br /&gt;    30. &lt;br /&gt;    30. &lt;br /&gt;    30.&lt;br /&gt;&lt;br /&gt;Look that y is a column vector like x (with 4 lines), it's correct because A is a square matrix (with 4 lines and 4 columns) and x is a column vector (with 4 lines).&lt;br /&gt;&lt;br /&gt;Using the rule dim(y) = dim(Ax) = [number of lines of A, (number of columns of A, number of lines of x), number of columns of x] = [number of lines of A, number of columns of x] (parenthesis out).&lt;br /&gt;&lt;br /&gt;I'll do more posts about vectors and matrices. Wait and see.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3054821536810158502?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3054821536810158502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3054821536810158502&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3054821536810158502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3054821536810158502'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/01/vectors-and-matrices-1.html' title='Vectors and Matrices - 1'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-5400647266630700856</id><published>2009-01-26T09:05:00.000-03:00</published><updated>2009-01-26T09:37:16.322-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='start'/><category scheme='http://www.blogger.com/atom/ns#' term='operations'/><category scheme='http://www.blogger.com/atom/ns#' term='variables'/><title type='text'>Starting Scilab</title><content type='html'>The first step for use Scilab is install it.&lt;br /&gt;&lt;br /&gt;GNU/Linux users can use the apt-get (apt-get install scilab scilab-bin scilab-doc), Synaptic or compile the codes (from &lt;a href="http://www.scilab.org/download/5.0.3/scilab-5.0.3.bin.linux-i686.tar.gz"&gt;here&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Window$ users can download the installer &lt;a href="http://www.scilab.org/download/5.0.3/scilab-5.0.3.exe"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;After install, let's use the Scilab.&lt;br /&gt;&lt;br /&gt;This is the initial screen.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IGuBPchcQ6w/SX2rlAeTLjI/AAAAAAAAASw/NbK6NxJWVxs/s1600-h/scilab.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://3.bp.blogspot.com/_IGuBPchcQ6w/SX2rlAeTLjI/AAAAAAAAASw/NbK6NxJWVxs/s320/scilab.png" alt="" id="BLOGGER_PHOTO_ID_5295577389128166962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Scilab is a interpreted programming language like Python.&lt;br /&gt;&lt;br /&gt;The showed screen is the Scilab's prompt, let's do something now.&lt;br /&gt;&lt;br /&gt;Write the commands:&lt;br /&gt;&lt;br /&gt;--&gt; x = 0;&lt;br /&gt;&lt;br /&gt;--&gt; y = 1;&lt;br /&gt;&lt;br /&gt;--&gt; z = 2;&lt;br /&gt;&lt;br /&gt;Each line declares a variable (&lt;span style="font-weight: bold;"&gt;x&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;y&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;z&lt;/span&gt;) and starts it value with &lt;span style="font-weight: bold;"&gt;0&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;1&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;2&lt;/span&gt;, respectively, in float format (in Scilab, all numbers are float, by default).&lt;br /&gt;&lt;br /&gt;Let's do operations with the variables now.&lt;br /&gt;--&gt;res1 = x + y - z&lt;br /&gt;res1  =&lt;br /&gt;&lt;br /&gt; - 1.&lt;br /&gt;&lt;br /&gt;--&gt;res2 = (x + y)*z&lt;br /&gt;res2  =&lt;br /&gt;&lt;br /&gt;   2.&lt;br /&gt;&lt;br /&gt;--&gt;res3 = (-x + y)/z&lt;br /&gt;res3  =&lt;br /&gt;&lt;br /&gt;   0.5&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With the 4 arithmetic operations, we can do any numeric simulation.&lt;br /&gt;&lt;br /&gt;In next posts, I'll show what the Scilab can do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-5400647266630700856?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/5400647266630700856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=5400647266630700856&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/5400647266630700856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/5400647266630700856'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/01/starting-scilab.html' title='Starting Scilab'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_IGuBPchcQ6w/SX2rlAeTLjI/AAAAAAAAASw/NbK6NxJWVxs/s72-c/scilab.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9101701713138538731.post-3673662649014611479</id><published>2009-01-15T10:08:00.000-03:00</published><updated>2009-01-15T10:24:49.281-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Presentation'/><category scheme='http://www.blogger.com/atom/ns#' term='free software'/><title type='text'>Presentation</title><content type='html'>This is my 1st dedicated blog and I created it just for teach something about &lt;a href="http://www.scilab.org/"&gt;Scilab&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The Scilab is a very powerful software for numeric computation.&lt;br /&gt;&lt;br /&gt;I'll share codes and programming technicals, but I'd like receive comments and interactions with the blog (votes in the polls, for example).&lt;br /&gt;&lt;br /&gt;Now, let's start the presentation.&lt;br /&gt;&lt;br /&gt;I'm a engineer of teleinformatics and I'm doing mastering in engineering of teleinformatics. My favorite study areas are digital images and signals processing, computational vision, patterns recogntion, computational intelligence and intelligent automation.&lt;br /&gt;&lt;br /&gt;I work with free software since 2004 (when I joined the University), I'm using just GNU/Linux for my own activities and works.&lt;br /&gt;&lt;br /&gt;I use Scilab since 2005 and I love it, because everyone uses the Matlab and I don't like proprietary software, I think free software stimulates the desire for knowledge. I like a lot learn new things and free software does it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9101701713138538731-3673662649014611479?l=usingscilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://usingscilab.blogspot.com/feeds/3673662649014611479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9101701713138538731&amp;postID=3673662649014611479&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3673662649014611479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9101701713138538731/posts/default/3673662649014611479'/><link rel='alternate' type='text/html' href='http://usingscilab.blogspot.com/2009/01/presentation.html' title='Presentation'/><author><name>Sheep</name><uri>http://www.blogger.com/profile/14503428177777397005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_IGuBPchcQ6w/S92SS5GAduI/AAAAAAAAAdg/Yxphluveg20/S220/Franciscan_Tau.JPG'/></author><thr:total>1</thr:total></entry></feed>
