Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Row vector issue in v0.5 #18805

Closed
krisztiankosi opened this issue Oct 5, 2016 · 2 comments
Closed

Row vector issue in v0.5 #18805

krisztiankosi opened this issue Oct 5, 2016 · 2 comments

Comments

@krisztiankosi
Copy link

krisztiankosi commented Oct 5, 2016

I generate a matrix:

julia> A=zeros(5,6)
5×6 Array{Float64,2}:
 0.0  0.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0  0.0
If I get the second column vector from A it is OK:
julia> A[:,2]
5-element Array{Float64,1}:
 0.0
 0.0
 0.0
 0.0
 0.0

But If I want to get the second row vector from A, it give back a column vector:

julia> A[2,:]
6-element Array{Float64,1}:
 0.0
 0.0
 0.0
 0.0
 0.0
 0.0

It should be a row vector. The quick workaround is to transpose the result, but mathematically the correct answer is a row vector.
I'm going back to version 0.4, that gives the correct answer.

(I did not find any open issue with that problem, If I missed it, please point me there.)

@yuyichao
Copy link
Contributor

yuyichao commented Oct 5, 2016

This is the intended behavior, you can use A[2:2 :].

@yuyichao yuyichao closed this as completed Oct 5, 2016
@andreasnoack
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants