How can I create a matrix from several vectors in Matlab?
<p><strong>Consider the following MATLAB function,</strong></p>

<pre><code>function m = gen_4_points()
    a = gen_const()% integer
    b = gen_const()% integer

    [x1  y1] = gen_start_point(a, b)% real
    [x2  y2] = gen_start_point(a, b)% real
    [x3  y3] = gen_start_point(a, b)% real
    [x4  y4] = gen_start_point(a, b)% real

    %r(1:4, 1:4) = 0;
    r = [   a b x1 y1 ;%int int real real 
            a b x2 y2 ;%int int real real 
            a b x3 y3 ;%int int real real
            a b x4 y4  %int int real real
        ];
    m = r;
end
</code></pre>

<p><strong>The resultant matrix is not my desired one.</strong> </p>

<p>Vector values are OK. </p>

<p>But, the resultant matrix has all integer values.</p>

<blockquote>
<pre><code>&gt;&gt; m  = gen_4_points();    
a =     
           0     
b =    
          -2 
x1 =
          -0.6766
y1 =   
          -2.3028
x2 =    
          -0.9189  
y2 = 
          -3.2118   
x3 =
           1.2869  
y3 = 
          -2.2803  
x4 =  
           1.5511 
y4 =  
          -2.4353 
&gt;&gt; m     
m =
           0          -2          -1          -2
           0          -2          -1          -3
           0          -2           1          -2
           0          -2           2          -2 
&gt;&gt;
</code></pre>
</blockquote>

<p>What is going on really?</p>

<p><strong>How can I fix the issue?</strong></p>