« first day (716 days earlier)      last day (2513 days later) » 

11:10 AM
@Adriaan unlinear
how about dislinear, antilinear, alinear, inlinear?
 
totesnotlinear
 
ah yes, that is probably the best term. Let me edit the question in question.
 
 
2 hours later…
1:10 PM
posted on June 16, 2017 by Sean de Wolski

Sean‘s pick this week is catstruct by Jos (10584). Have you ever had to structures and wanted to combine them into one? The above question is kind of ambiguous. Do you mean? firststruct.x = pi secondstruct.x = exp(1) combinedstruct = [firststruct secondstruct] firststruct... read more >>

 
 
2 hours later…
2:40 PM
@Feeds I was worried there'd be no cats
 
 
6 hours later…
8:36 PM
Tonight is going to be verrrryyy interesting
I will let you guys know the results of the night. As obscure and ominous as that sounds lmao. Very likely I will be a single gent (think I need it though) 😉
 
ooookay...fingers crossed (for whatever is the preferred outcome :D)
you'll need all 3 days of singlehood? :P
 
bahaha no I just mean in general
I hopped from one relationship onto another with little to no breather in between .. wasn't a smart idea
@AndrasDeak Right now I'm not sure TBH, but leaning towards walking away
 
I half expect a pregnancy test to be involved
 
9:03 PM
hahaha no
It involves a really really shitty thing that she did
 
9:23 PM
You surely refer to those videos :-P
 
 
1 hour later…
10:33 PM
@ballBreaker I hope concrete slippers will not be involved :P :D
 
11:03 PM
Interesting question. Does anyone have any idea?
2
Q: Advanced Matlab: colon indexing of singleton dimension in assignment

rootConsider this in Matlab: >> clear M, M(:,:,:,1,:)=rand(10,10,2,1,5); size(M) ans = 10 10 2 1 5 >> clear M, M(:,:,:,1,:)=rand(10,10,1,1,5); size(M) ans = 10 10 5 >> clear M, M(:,:,1,1,:)=rand(10,10,1,1,5); size(M) ans = 10 10 1 1 5 Why doesn't the 2nd code line behave like the 1st o...

BTW, this Mathworks page says clear A; A(:,:,2) = 1:10 gives an error, but it doesn't (R2015b here)
Hm, I originally misunderstood the current answer. Now that I got it, I think it may have hit the nail in the head
 
yeah, that's a good question
 
11:33 PM
added my two cents
 
You are right, it's an edge case. This is related to my comment above about the Mathworks page saying something and Matlab doing otherwise
 
there's probably some handwaving rationale behind it
 
Ooh you dived into subsasgn!
 
well "dived into" might be an overstatement :D
I should reformat the code blocks I guess
 
Ah, I thought you had looked into subsasgn code. But that's not possible :-(
 
11:36 PM
yeah, that's my point
 
Better format now, yes
 
unless someone has ancient matlab which might have open source subsasgn, this is a dead end
I wouldn't even be surprised if this had been a built-in since the beginning
 
It may have something to do with this:
> The values are poured in from the right-hand side ordered as if that array had been turned into a column vector.
 
I don't think so...there seems to be an explicit squeezing going on when a singleton dimension is indexed with colon
my hunch is that there's an explicit check for colonizing into a singleton dimension
 
With b32sumAll(:) = ... the size of b32sumAll needs to have been defined earlier
 
11:45 PM
Exactly. Because M is being allocated at-assignment, the colon dimensions are filled-up in-line, and without an explicit dimension, MATLAB tries it's best to maintain shape.
By the implicit squeeze is a little odd.
 
what's highly suspicious to me is that replacing just one of the singletons removes both
OH SHIT
>> N = rand(10,1,10,1,1,5); clear S; S.type='()'; S.subs={':',1,':',':',1,':'}; size(subsasgn([],S,N))

ans =

    10     1    10     5
the plot thickens
only contiguous dimensions are squeezed out
there goes my answer
 
What doesn't help any of this is the fact that MATLAB arrays have an implicit, infinite number of trailing singleton dimensions:
>> A = rand(5,1); A(:,1,1,1,1,1,1,1)
ans =
    0.7447
    0.1890
    0.6868
    0.1835
    0.3685
 
@AndrasDeak From this it appears non-contiguous singletons are being squeezed, aren't they?:
>> clear M, M(:,:,:,1,:)=rand(10,10,1,10,1,5); size(M)
ans =
    10    10    10     1     5
>> clear M, M(:,1,:,:,:,:)=rand(10,10,1,10,1,2,1,5); size(M)
ans =
    10     1    10    10     2     5
Anyway, considering that Mathworks say that clear A; A(:,:,2) = 1:10 gives an error (it does not) and that one should define the shape of the target array A first, I don't think we'll find any official info
 
What I mean is that : will squeeze what you use it for, plus every singleton that touches it
 
? Example without subasgn?
 
11:53 PM
fuck, no
 
I really do think all of this comes down to subasgn and Loren's essentially saying that any : assignment will act "as if that array had been turned into a column vector." The values are poured into the array, respecting explicit dimensions as needed, and omit any trailing singleton dimensions since they are implicit in MATLAB's world.
 
@AndrasDeak Have you found any counter-example to the hypothesis that all singletons are squeezed out?
 
yes
 
@TroyHaskin But here there's another ingredient: the shape of the target (left-hand) array is now known in advance
 
I just wanted to update my answer first
>> clear M; M(:,1,:,1,1,:,:) = rand(10,1,10,1,1,1,5); size(M)

ans =

    10     1    10     1     1     5

>> clear M; M(:,1,:,1,:,1,:) = rand(10,1,10,1,1,1,5); size(M)

ans =

    10     1    10     1     5

>> clear M; M(:,1,:,:,1,1,:) = rand(10,1,10,1,1,1,5); size(M)

ans =

    10     1    10     5
 
11:56 PM
@LuisMendo Is it? If it's clear-ed and there's :, the shape-size combo may not be able to be satisfied. I think it's clear to us what the shape should be, but to a general interpreter written for all sorts of assignments and flexibility?
 
@AndrasDeak But all those conform to the squeeze hypothesis. Enclosing the RHS with squeeze gives the same result
 
I meant squeeze-ing the result
 
@AndrasDeak So like right here, MATALB doesn't know how big the :-columns should be, so it fills them left-to-right, has three left-over, essentially redundant singleton dimensions, and ignores them since they may be implicit trailing singletons.
 
@TroyHaskin Hm I'm not sure I follow, sorry :-)
 
hmmm
 
11:59 PM
>> clear A
>> A(:,:,1,1,1,1,1,1,1) = rand(2)
A =
    0.9746    0.5190
    0.1199    0.8220
 
@AndrasDeak I don't think the result (LHS) is being squeezed. In the last example, trailing singletons are just not shown
 
"last example" where?
 
@AndrasDeak clear M; M(:,1,:,:,1,1,:) = rand(10,1,10,1,1,1,5); size(M)
 

« first day (716 days earlier)      last day (2513 days later) »