Re: [julia-users] Octave diag and Julia diag

2014-04-27 Thread John Code
gt; > but it is often better to use Diagonal, which creates a special Diagonal > matrix, > > julia> Diagonal([1,2,3,4]) > > 4x4 Diagonal{Int64}: > 1 0 0 0 > 0 2 0 0 > 0 0 3 0 > 0 0 0 4 > > > 2014-04-27 21:40 GMT+02:00 John Code >: > >

[julia-users] Octave diag and Julia diag

2014-04-27 Thread John Code
Hi all, I would like to ask why there is a difference between Octave diag function and the function that julia provide. For example, in the following Octave session I get: octave:1> v = [1 2 3 4] v = 1 2 3 4 octave:2> a = diag(v) a = Diagonal Matrix 1