Semantically, ones(n,1) creates a vector and not a matrix.
Why is ones(n,1) different from ones(n)?
The type system is very confusing and non-intuitive.
On Sunday, November 16, 2014 7:28:28 PM UTC-5, Andreas Noack wrote:
The input should be two Vectors, but your first argument is a Matrix
Semantically, ones(n,1) creates a vector and not a matrix.
I'd rather say that in MATLAB ones(n,1) creates a vector.
This has been discussed many times on the list and in issues. In
particular, see the famous https://github.com/JuliaLang/julia/issues/4774.
In Julia, Vector{T} and Matrix{T}
which I think is reasonable is a subjective argument.
It would be helpful if the type system is intuitive and non-confusing to
programmers.
On Monday, November 17, 2014 12:24:58 PM UTC-5, Andreas Noack wrote:
Semantically, ones(n,1) creates a vector and not a matrix.
I'd rather say that in
What's intuitive is very dependent upon your background. If you're coming from
Matlab, for example, everything is a matrix and Matlab does this
extraordinarily-confusing thing:
ones(3,3,3) gives me a 3d array;
ones(3,3) gives me a 2d array;
but
ones(3)
ans =
1 1 1
1 1
I don't know what matlab does.
As a user, ones(n,1) and ones(n) both return me a vector, and it is
confusing to find that ones(n,1) != ones(n).
On Monday, November 17, 2014 12:53:25 PM UTC-5, Tim Holy wrote:
What's intuitive is very dependent upon your background. If you're coming
from
Your best bet, then, is to decide as quickly as possible whether you want to
use Julia. If you start reading here:
http://docs.julialang.org/en/latest/manual/faq/#what-does-type-stable-mean
you'll maximize your chances of quickly discovering other things that will
likely annoy you :-). While
On Monday, November 17, 2014 12:02:07 PM UTC-6, Eka Palamadai wrote:
I don't know what matlab does.
As a user, ones(n,1) and ones(n) both return me a vector, and it is
confusing to find that ones(n,1) != ones(n).
As Andreas and Tim have tried to say, your claim that ones(n,1) and
As a user, ones(n,1) and ones(n) both return me a vector, and it is
confusing to find that ones(n,1) != ones(n)
I was where you are now a few months ago. It's a learning cure thing, I
think, because now I don't make that mistake
anymore or I'm like, oh yea, of course and change it 2
Thanks.
Fortunately (or unfortunately) i have to use julia, and will have to make
noise
where something is confusing.
On Monday, November 17, 2014 1:26:09 PM UTC-5, Tim Holy wrote:
Your best bet, then, is to decide as quickly as possible whether you want
to
use Julia. If you start reading
SymTridiagonal does not seem to work properly.
For e.g, the following snippet fails.
julia n=10 ;
A=SymTridiagonal(2*ones(n,1), -1*ones(n-1));
ERROR: `convert` has no method matching convert(::Type{SymTridiagonal{T}},
::Array{Float64,2}, ::Array{Float64,1})
in call at base.jl:34
Any
The input should be two Vectors, but your first argument is a Matrix
2014-11-16 19:25 GMT-05:00 Eka Palamadai ekanat...@gmail.com:
SymTridiagonal does not seem to work properly.
For e.g, the following snippet fails.
julia n=10 ;
A=SymTridiagonal(2*ones(n,1), -1*ones(n-1));
ERROR:
11 matches
Mail list logo