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

Allow 1 element array to behave as single element of appropriate type #4033

Closed
ggggggggg opened this issue Aug 12, 2013 · 1 comment
Closed

Comments

@ggggggggg
Copy link
Contributor

The following works in MATLAB, and it would be nice to have the same functionality in julia. It seems easy to do by defining the appropriate cases for convert.

Julia Studo 0.3.2

julia> a = [1]
1-element Int64 Array:
 1
julia> b = [1:4]
julia> b[2]=a
no method convert(Type{Int64},Array{Int64,1})

MATLAB

>> a = [1];
>> b = [1:4];
>> b(2) = a

b =

     1     1     3     4
@JeffBezanson
Copy link
Sponsor Member

Embedding scalars as arrays is discussed in #3262.

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

2 participants