« first day (1477 days earlier)      last day (1745 days later) » 

7:51 AM
@AndrasDeak I just ran that command and now MATLAB no longer crashes; doc looks horrible (i.e. basic), and the NPE I get when closing MATLAB is still present. Oh well, I guess they're fine with it.
What I don't like is that I got an automatic reply saying Our initial analysis indicates this crash was the result of an unknown issue. and then a reply from an employee saying This seems to be a known issue by our developers.
If it's a known issue, then tell me that in the first place, along with the recommended fix -.- Saves both me and the company valuable time
 
if they could edit the error message they could add the fix if it were a fixable issue :)
it's known by helpdesk but not known by your matlab
 
8:36 AM
But I got an email a few hours after sending the bug report with that message that it is an unknown issue; that wasn't MATLAB mentioning it on the crash report or something. That automated email could've told me the recommended fix instead
 
Oh, I see, sorry, I misunderstood
yeah, that sounds much worse
 
9:21 AM
man my matlab habits are messing up my python
ok maybe I can bother someone here: Can I vectorize somehow col = [1,2,0,1,1]; z=np.zeros((5,3)); for k in range(5): z[k, col[k]] = 1?
(col contains the indices of the position of a single 1 in each row of an otherwise zero matrix)
 
definitely
z = np.zeros((5,3))
z[range(z.shape[0]), col] = 1
 
oh, so z[: , col] = 1 is not the same as z[range(...), col] = 1???
@AndrasDeak thanks a lot!
 
@flawr indeed, they trigger a different kind of fancy indexing
The former says "take every row, and also the columns in col". The latter says "take every (i,j) pair from zip(first_indexing_array, second_indexing_array) and use those as indices"
 
9:36 AM
thanks for the explanation
kinda confusing
 
fancy indexing can indeed be, but you can get used to it
 
its probably more a question of whether I want to get used to it :)
 
yup
 
10:27 AM
I was tempted to go vandalism on it
 
I'd say it's too minor
 
no improvement is what I selected in the end
 
yeah.. rejected now
 
10:40 AM
@Adriaan hahaha
 
 
3 hours later…
2:04 PM
@Adriaan: This is a nice answer (+1), but I don't follow the last paragraph. Are you sure that double has double the number of unique values that a single has? Double the number of bits means 2^32 times as many unique values...
 
2:20 PM
Should this question remain tagged with ? It appears to be a MATLAB question (and the title before my edit was quite clear about it, starting with "MATLAB: ")....
 
@Dev-iL No, it shouldn't
 
@Dev-iL no, feel free to remove it
it's not the first such confused OP
 
ok, done. thanks!
 
 
1 hour later…
3:48 PM
@AndrasDeak very cool answer here
 
4:32 PM
Weird. I'm pretty sure I saw a question very similar to this one last year some time, but I can't find it back.
 
5:06 PM
@AnderBiguri thank you :)
 
5:40 PM
Should I make this community wiki? stackoverflow.com/a/57081470/8239061
@Adriaan 's comment was very relevant and thought I'd try to write the two major options as I saw them.
 
I suspect @(z) u(z) is an anti-pattern, I'd think that's always @u
I'd vote to dupe it with Adriaan's target, but 1 more vote will close it and I don't have a gold badge
and a function handle is not the same as an anonymous function
 
I didn't mean to step on your edit there, was already working an edit.
 
it's OK, mine went through, I just removed a single character
and you fixed that anyway I think
Oh, it's also a typo. Function called u, return value called o... Blargh
 
Dupe target reads: "This tells Octave that f is not a variable, but actually is a(n anonymous) function, in this case of z, which is the first argument."
Should I just stick with "function handle"? Should I delete the answer entirely?
Or should I add a working example (though the MATLAB doc has that already...)? Maybe I was too quick to answer this.
 
You should stick with function handle. An anon function is in itself a function handle, and you can have handles to named functions such as @sin or @u for OP.
 
5:52 PM
ty
I've updated with links to the function handle page in doc.
 
Already did after your SOCVR [cv-pls] request
@AndrasDeak do you mean use fminsearch(@u,z0) rather than fminsearch(@(z) u(z),z0) when you mention antipattern?
 
yes, assuming the former works
 
I know the antipattern works. I'll test the other now - thanks for learning me.
 
it's ike doing [1:5] instead of 1:5, it's irrelevant fluff that might even harm performance
 
6:06 PM
I see.
 
(microscopic performance hit, but still unnecessary)
 
Works like a charm. ty again
 
no problem
 
This new question seems related to this old one.
 
6:49 PM
@CrisLuengo I didn't test it (MATLAB was busy) but iirc it has 64bit numbers, as opposed to single, which has 32 bits
 
 
1 hour later…
8:08 PM
@Adriaan Right, 32 more bits means 2^32 more combinations.
 
Very interesting code indentation formatting. Must be the new style.
 
@CrisLuengo not worth your doctor's bill ten years from now
 
@SecretAgentMan And the line breaks half-way comments is nice too.
 
@AndrasDeak That's what I meant with "asshat wasting my time" :p
 
8:10 PM
I figured :P
@SecretAgentMan I suspect it's a polyglot that runs in MATLAB and whitespace
 
Ah good call
 
credit where it's due, at least they spelled your name correctly
2
 
LOL!
 

« first day (1477 days earlier)      last day (1745 days later) »