« first day (313 days earlier)      last day (2930 days later) » 
06:00 - 16:0016:00 - 00:00

4:00 PM
@beaker Well, eye is just 1
The really strange thing to me is that x = []; if x... won't enter the if branch, but if all(x) will. That's an odd behaviour of if.
 
well all(x) would give true right?
I guess it's undefined for empties :D lol
 
@rayryeng all of the elements that are there are non-zero ;)
 
haha :D
true.
 
@beaker "Vacuous truth"
 
So this really means that you can make something from nothing.
 
4:03 PM
In mathematics and logic, a vacuous truth is a statement that asserts that all members of the empty set have a certain property. For example, the statement "all cell phones in the room are turned off" will be true whenever there are no cell phones in the room. In this case, the statement "all cell phones in the room are turned on" would also be vacuously true, as would the conjunction of the two: "all cell phones in the room are turned on and turned off". More formally, a relatively well-defined usage refers to a conditional statement with a false antecedent. One example of such a statement is...
 
yup
 
heh, I learned something today!
 
Wanna learn something else? I bet you don't know this:
The doc says:
 
eval is great?
 
help if
[...]
The statements are executed if the real part of the expression
  has all non-zero elements.
 
4:07 PM
what? LOL
 
[...]
But it's not that way!
 
no! it isn't!
 
>> if 1+1j, true, else false, end
Complex values cannot be converted to logicals.
@rayryeng of course, because it allows dynamic variable names
 
That description doesn't adequately explain it for strings either.
There is no "real part" about strings.
>> if 'hello', true, else false, end

ans =

     1
unless they convert the string into an array of ASCII values
 
Yes there is :-)
>> real('hello')
ans =
   104   101   108   108   111
 
4:09 PM
>> if [1+1j], true, else false, end
ans =  1
 
yes I already said that :P
 
@beaker Octave, right? In Matlab it fails
 
yeah that's Octave.
I tried it for both
 
@rayryeng Yup :-)
 
hm
 
4:10 PM
I'm actually trying to break the if statement :D Seeing what I can throw at it
 
The strange thing is that, if I remember correctly, the claim "The statements are executed if the real part of the expression has all non-zero elements" used to be correct in old Matlab versions. I think they changed that (why?), but forgot to update the doc
 
They've updated the docs on MathWorks... the wording is different... but it very clearly says that it has to be either logical or real numeric
So it's even more clear cut
 
>> why
To fool some mathematician.
 
if expression, statements, end evaluates an expression, and executes a group of statements when the expression is true. An expression is true when its result is nonempty and contains only nonzero elements (logical or real numeric). Otherwise, the expression is false.
 
So they updated the web documentation, but not the command-line help (at least in R2015b)
 
4:15 PM
yes. I'm also on R2015b
I've updated only recently lol.
 
doc if gives the same as the web. It's help if that's different
 
oh?... hmm
yup then they just forgot to update the if.m file :D
which of course only contains the docstring
 
Not anymore
Some functions don't have m file, and they still have that type of help
I don't know where it is defined
 
if still does... at least for now... if you do edit if.
 
Oh, sorry
You're right
Same for find
I was fooled because type if or type find don't work
 
4:22 PM
right :)
I can't believe no one caught this mistake
This accepted answer provided the use of fread as follows:
fid = fopen(...);
fread('fid', ...);
Goes to show you that people accepting answers really don't read the answers.
That answer was being referenced by this question:
0
Q: Can't Visualize Ascii File on Matlab

uomodellamansardaI have .txt file created by an STM32 connected to a accelerometer sensors. This file are Ascii file (probabily 8bit) I tried to visualize on Matlab using ZZ = load('000_LOG.TXT', '-ascii') Error using load Unknown text on line number 1 of ASCII file 000_LOG.TXT so i tried zx = load ('...

 
@rayryeng That's pretty egregious.
 
@TroyHaskin No kidding lol.
Even though that question was asked over 2 years ago.... I'm still surprised to see that no one caught that error.
 
Oh, it's from 2013!
 
yup lol.
 
I didn't look at the date. But then I saw a comment by chappjc, who is not active since quite some time
 
4:28 PM
hehe I know :)
He's around... when there is a MEX question that pops up, he answers.
 
Yes, he's into MEX. Pity :-) accumarray misses him
 
@Adriaan that spin flipping thingy is for ferromagnets, I think
if you flip a single spin in an ordered FM state, the perturbation will kinda disperse outwards
 
I know :)
I haven't used accumarray in a while.
 
turns out after an operator transform that bosonic operators describe these lowest energy excitations
 
I still however keep getting votes for my Mutual Information answer.
 
4:31 PM
@Dev-iL hey sorry man, lol got completely side-tracked with work right as you askedd me
 
@ballBreaker I've resolved it... Got something quite cool tbh
 
righteous man!
is it a gaydar?
the needle points towards the gays
 
Thanks for keeping this room totally PC.
:D
 
@rayryeng The PC is a lie!
 
lmao
@ballBreaker how's it going man?
 
4:35 PM
@ballBreaker Yes, in the broad sense... It's only 2D you see... So in reality it's just a projection of an N-dimensional gaydar
 
Nice.... Dimensionality Reduction of the Gaydar space.
use PCA on that badboy!
 
lmfao
@rayryeng Maaaan I've been so ridiculously busy the past 7 days with work
Have barely been in here at all
@Dev-iL Ahhh, so it only detects gay broads?
 
yeah I know lol. I haven't been here as often tierh.
@ballBreaker Progress with Tesla. I'm flying out in a couple of weeks for an on-site interview.
 
oh dopeness!
Is it in Cali as well?
 
Once I passed that coding challenge I told you about, I talked to the VP of the autopilot program.... then I talked to two of the engineers on the team after.
This shit has been going on for about a month.. nothing but phone calls.
 
4:38 PM
(They flying you out, or do you need to fork the money?)
 
nah man, they're flying me out.
 
Good good
 
I filled out a travel information form and everything
 
pre-investment is good
 
so they're paying for the flight, hotel.
I also got approved for a car rental.
Dopeness. Gonna drive around the area and see what's going on.
 
4:38 PM
They'll already have invested this much time and money into you... more likely to just hire you in the end haha
 
I sure as hell hope so lol. I gotta GTFO of here
 
Yeah?
I hate Toronto as well
(if that's what you mean)
 
ahh nah it isn't Toronto. I love it here... I just hate this company
 
Fair enough man
 
yeah man.
The thing with this company is the culture.... I don't get a sense of passion or them being proud of the product that they're producing.
 
4:39 PM
I'm going to go for lunch though, I'll be back in a bit. Congrats on the progress though man
 
I just get the sense that every day I come in, people are just working... just to clock in/clock out and get their paycheck... sure it applies to most places.
 
If you meet elon musk tell him I probably sat in the same seats as he did at Queen's university
 
but I'm at a point now where if I work with people who don't give a shit, then why should I?
nice nice.
 
And I absorbed some of his genius through my butt pores
 
actually, I interview with him as the last part of the interview lmao.
The very last part of my interview... before I leave...
 
4:40 PM
Seriously? lmao
 
I spend half an hour with him.
Suffice it to say I'm scared and intimidated as fuck.
 
Then yeah, don't forget to include the butt parts
Explain to him the theory of relative genius absorbed through butt-stuff
 
lmao.
 
He'll probably enjoy that
 
I'm seriously... just tempted to ask him just one question...
"How the fuck do you do it?"
 
4:42 PM
He'll probably respond with something like
"well I put my pants on in the morning... fuck my hot wife.. go to work.. ya know, the usual"
 
lmao. shit. If he seriously does, I'm gonna try and record it
 
@rayryeng the real question is why a((length(a)+1):end) works :|
 
but we'll see how it goes buddy. I fly out on the 26th. interview 27th and fly back 28th.
 
lool
 
@excaza and a is empty yes?
 
4:43 PM
(his wife is super hot though, seriously)
 
@ballBreaker hahaha I know eh?
 
(ask him if I can bang her, like if their into cuckold stuff, please)
 
the return is empty, yes
a = ones(5,1); b = a((length(a)+1):end);
 
(but no worries if they aren't)
 
lolol
hmm length(a)+1:end would return the empty array no?
 
4:44 PM
lool anyways brb lunchtime
 
and indexing into an array with [] should give empty. That is defined
@ballBreaker lol alright. later man
 
but why does it return an empty array
a(length(a)+1) should error
 
length(a)+1:end is basically length(a)+1:length(a)
which produces an empty array as you are generating a sequence that is impossible
and so a([]) produces []
 
but it makes my brain hurt
 
lolol.
in our case, you are trying to create an array such that 6:5
since length(a) = 5. This is empty as you can't start at 6 and iterate upwards by 1 and end at 5.
 
4:46 PM
right, I get that
 
so you produce the empty array... and you index into a. Indexing into a with an empty array always gave you empty.
 
it's just not intuitive (to me, at least) that end essentially resolves to length(a)
 
For 1D it's well defined... if we tried 2D, I have no idea wtf it would make
 
numel(a), maybe
or I could take my own advice and RTFM
3
> The end function also serves as the last index in an indexing expression. In that context, end is the same as size(X,k) when used as part of the kth index into array X.
 
aha, yup :)
 
4:49 PM
ugh
I hate myself sometimes :p
 
Erg. Even though the current answer gives a better result than my one-liner, I'm a little annoyed that this user is basically saying "I know there is something better. Find it for me."
@TroyHaskin Thanks it was very good. Although i am still looking for more efficient way. — Reza Sh 2 hours ago
 
@RezaSh Define your criteria you used to assess why Troy's code is "inefficient" compared to what you desire. — rayryeng 12 secs ago
I asked him to put his money where his mouth is.
 
it's inefficient because I have to expend brain power figuring out wtf bsxfun is doing ;)
code like I'm 5 please
 
Both my solution and Mohsen Nosratinia's are an order faster than the generic intersect. I don't think we can do better without going to MEX.
 
@excaza yeah that's a mouthful, but quite easy to explain.
@TroyHaskin I agree.
 
4:53 PM
The question also hits my "why are you using intersect with numeric data when performance is important to you?" button.
I've always found intersect to be extremely slow for numbers compared to straight computation.
 
sort(y(any(bsxfun(@eq,x(:),y(:).'))))
1. bsxfun(...) creates a binary matrix where each element (i,j) denotes whether x(i) and y(j) are equal to each other.
2. any searches along the columns of the matrix produced by 1. to see if there are any non-zero elements.
3. We use the result from 2. to index into y which means that we only extract out the elements in y that matched any element from x.
4. Sort the result from 3.
So this basically returns all values of y that can be found in x.
i.e. the intersect function.
 
@AnderBiguri I found that video a few weeks ago. Laughed my ass off.
 
The sort is necessary because that's how intersect behaves if you called it in MATLAB. It returns the common elements in sorted order.
 
@rayryeng Are you mat-splaining my own one-liner to me?
 
@TroyHaskin lol no. to excaza.
 
4:57 PM
Ah.
 
He didn't understand your one-liner.
He said... and I quote...
"it's inefficient because I have to expend brain power figuring out wtf bsxfun is doing ;) code like I'm 5 please"
 
<3
 
Ah! Missed that.
 
I see bsxfun and my brain shuts off
 
lmao yeah... it takes practice my friend.
 
4:58 PM
@excaza I do the same with accumarray ... though I am making strides.
 
I just kept using small examples and playing around with the functions until I got it right
 
Even posted an answer using it recently.
 
@excaza Understanding how bsxfun replicates with 1D vectors is something you need to master first. Take for example:
 
@rayryeng reminds me of when I bountied my own RTFM post
 
A = bsxfun(@plus, [1; 1], [10 12])
Remember that bsxfun creates two temporary matrices of compatible sizes... so the first matrix is size 2 x 1, and the second is 1 x 2.
bsxfun will make sure that the two temporary matrices match in size. If there are singleton dimensions, you increase the total number of elements in that dimension to match the other matrix
so you actually will produce two matrices of size 2 x 2. The first matrix gets created by replicating [1; 1] horizontally and the second with [10 12] vertically.
so it would be the same as doing A = repmat([1; 1], 1, 2) + repmat([10 12], 2, 1);
 
5:01 PM
neat
 
so that's why Troy did with bsxfun(@eq, x(:), y(:).')
 
But I think internally the matrix creation is implicit for performance and memory efficiency, right?
 
x is a column vector, y a row vector... and this would produce a matrix where each element (i,j) determines if x(i) == y(j).
@TroyHaskin yup that's right.
The temporary "replicated" matrices are implicit for performance and memory efficiency.
so if you wanted to code as a 5 YO @excaza, the code is basically doing:
A = false(numel(x), numel(y));
for ii = 1 : numel(x)
    for jj = 1 : numel(y)
        A(ii,jj) = x(ii) == y(jj);
    end
end
 
you're the best :)
 
or even... A = repmat(x(:), 1, numel(y)) == repmat(y(:).', numel(x), 1); :P
but yeah you get the point I think.
heh thanks :)
@excaza I make sure to edit because doesnt worth separate answer.
 
5:08 PM
:D
that took me a second haha
 
:D:D
Gotta love his comments... absolutely useless.
Remember that time where he suggested to look at four functions that were unrelated to the question?
 
sometimes there are gems :)
Apr 25 at 15:53, by excaza
@rayryeng A = cell(ones(1), n); [A{2:n-1}] = deal(NaN); A = [ones(1) cell2mat(A) ones(1)]; A(isnan(A)) = zeros(1);
 
OH OH :D lol
We should seriously have like an obfuscation contest.
Someone write very complicated looking code and figure out what it's doing.
no using the MATLAB command prompt or anything :D
 
I figure all the MATL and bsxfun nerds would clean house
:P
 
hehehe :)
1
Q: How can I declare a matrix in Matlab where the column size is not fixed?

FaikaI have MATLAB code that I need to convert to C using the MATLAB Coder. Here few lines of the code: for k = 1 : K delay_points_local(k,:) = arg_max_tau(k) - 0.3 : step_tau : arg_max_tau(k) + 0.3; CFO_points_local(k,:) = arg_max_CFO(k) - 0.005 : step_CFO : arg_max_CFO(k) + 0.005; [...

^^^^ It sounds like the OP wants to create a matrix with a variable number of columns per row.
 
5:15 PM
oh
 
posted on May 09, 2016 by Cleve Moler

Gil Strang has produced a MOOC-style video course on Differential Equations and Linear Algebra. I have added some videos about the MATLAB ODE suite. The series is available from the MathWorks Web site, MIT OpenCourseWare and several other popular sources.... read more >>

 
@rayryeng I think they're trying to figure out how to grow an array in C
oooh... Gil Strang video :D
 
Strang is awesome. I actually had to watch his Linear Algebra videos a few years ago
I had to watch them because there was a graduate course that relied on it heavily and I was terrible at it
 
@rayryeng LOL... I did the same thing
 
@beaker :D:D
 
5:18 PM
"How hard could it be? It's just algebra"
I'd have to vote linear algebra as the most misleading subject title of all time
 
You gotta LOVE those roller chalkboards with the big ass chalk.
@excaza yeah I agree.
 
Yeah! Was he using sidewalk chalk or something?
 
@beaker Strang probably has the biggest pectoral muscles known to man. The amount of erasing that he does...
 
Then day 2 you hit inverse upper sideways super diagonal
 
@beaker I think so!
He probably uses it because it's the only thing that'll stand up to the amount of pressure he puts on the chalkboard.
those lil' pitiful Crayola chalks? pffft lol
 
5:20 PM
plus, he had over 100 students in the room... i'm sure he had to use the fat chalk just so they could all see
 
oh yeah.
But I say that man made me understand column space and null space well.
 
i remember trying to see the board in my first physics class... huge auditorium with little bitty blackboards
 
oh yeah... and this was before I had glasses and I was in denial.
and it sucked when I came into class late... that meant I had to go to the back
and I couldn't see for shit... so I had to keep bugging people beside me to figure out what was being written.
Now that's a thing of the past... in comes projectors and tablets.
 
that was so funny... one day our physics professor came in and used a projector... the next class he was back to writing on the blackboard
everybody's like "why no projector???"
it was so much easier to follow, but apparently he didn't like projectors and only used them when he had to use copies of some material
 
I had a prof that was so old school that he still was using those stupid clear sheets of acetate.
diagrams and formulas and shit lol.
No.. forget using a computer and showing us on the screen... no...
acetates from Circa 1950 whatever.
 
5:24 PM
My astronautics class was all chalkboards
that wasn't fun
Sadly despite acing astronautics I'm total garbage at Kerbal Space Program
worst aerospace engineer ever
 
@excaza lol... I've never played that, but it looks like fun :D
 
5:42 PM
Currently running three Matlab instances: one for simulation running waiting for a crash; one for debugging trying to fix the last issue I found that cause the crash; and one for doing side calculations during the debugging process so I don't need to deal with that static workplace crap. ... I'm going a little mad.
 
hahaha oh boy
is this crash deterministic? How come you're waiting for it to crash?
never mind. I can't read
Are you running some MEX function?... or is MATLAB running out of memory?
 
@rayryeng "Crash" meaning the simulation errors or goes NaN.
 
ohhhh
yeah that's never good
Actually, one of the people that I used to read on SO quite often... said that he would rather have code that crashes instead of having code that doesn't crash with bugs.
 
posted on May 06, 2016 by mgarrity

The dodecahedron is a particularly interesting polyhedron. It's full of interesting five-fold symmetries. Let's take a look at a couple of them.... read more >>

 
5:47 PM
@rayryeng There is something to be said about that attitude. But then no software would ever be sold commercially since bugs always exist for any decently complicated program.
 
I really thought that @feeds subheader said doucheahedron
I need more coffee, clearly
All I do to fix errors is to wrap my entire codebase in a try/catch block that eliminates all errors :)
 
@excaza That works!
I also used to tell my tutees that multiplying both sides of an equation by 0 balanced it immediately.
 
try
    myfunction
catch err
    disp('Success!')
end
 
Now whether the balance was "correct" is a matter of definition, degrees, and time.
 
@TroyHaskin What do you think of this question?
0
Q: matlab - result too complicated

Joita DanI hope I'm clear, haven't used matlab in a long while (and I was never good at it). brieffly, ca=3.96; c0t(1)=2*ca/10; .... syms c0 c1 c2 c3 c4 c5 c6 c7 c8 eqn1 = c0(1)+c4(1)+c8(1) == c0t(1); .... eqn9 = c8(1)==c1(1)^2*c0(1)*c3(1)*10^8.1; sol = solve([eqn1, eqn2, eqn3, eqn4, eqn5, eqn6, eqn7, e...

 
5:59 PM
I think the question is too complicated :p
 
Already looking at it, shaking my head, and laughing.
 
reading the actual code is making me dizzy
 
Oddly enough, the only decent dup I found was this.
But it's old, brief, doesn't cover edge cases ... and I'm late for a meeting.
 
lol see ya!
 
> (and I was never good at it)
lmao
 
6:03 PM
It's here!
 
You goin' to space?
 
my graphics are going to space
> Elimination of cross-strokes in the two "A" letters imparts a vertical thrust to the logo-type and lends it a quality of uniqueness and contemporary character
 
©1959
 
> This warm shade of red is a very active color which brings a kinetic dimension to the letterforms. The color reflects the lively and future-oriented character of NASA
@beaker 1976
 
All I can see is N-Penis-S-Penis
 
6:08 PM
that's a weird penis
pen penis
> NASA red should not be used with other bright saturated colors, or medium and dark value colors, as they will dilute the effectiveness and impact of the NASA red
damn
graphic designers don't put up with any bullshit
 
wtf? where are you reading this? lol
 
@rayryeng whoah shit break a leg with The Musk
 
the NASA graphics standards manual
 
also, tell him "lol you can't land rockets, n00b"
 
@AndrasDeak No kidding. I'm intimidated as fuck lol
 
6:10 PM
bam
> Helvetica is the most important family of type in the NASA Unified Visual Communications System
#helvetica4life
 
wow lol
 
3 stars already?
dammit
I'm so embarrassed :(
 
6:32 PM
How about you provide all inputs. I have a problem with my car...but I only give you the headlight...fix it. stackoverflow.com/help/mcveMatt 23 mins ago
I should use this as my copypasta
 
YES lol
 
7:37 PM
@excaza Everyone loves helvetica
 
 
1 hour later…
8:56 PM
@LuisMendo oi!
 
@excaza But the NASA use the jet colormap :-P I saw it!
@rayryeng Hey!
 
@LuisMendo It would make sense that they use jet :D
Maybe they should rename jet to shuttle.
 
@rayryeng Haha. That's what I asked the guy. Is that colormap named after JPL?
 
hahahaha nice.
 
He said no, that he was aware of :-)
 
8:57 PM
:D
 
@rayryeng Nice idea!
 
@LuisMendo I'm not sure who would win though.... I think MATL is already obfuscated enough :D
 
@excaza I once saw an answer by Divakar that used 6 dimensions
 
yup... i still have that bookmarked.
 
@rayryeng Haha. And getting a little more so every time
 
8:59 PM
It's actually one of the answers he is proud of... on his profile
 
Oh, haha, I see. I'd be proud of that too
 
9:30 PM
I think I'll be able to tame the AppDesigner UI elements pretty soon :)
 
 
2 hours later…
11:28 PM
0
Q: How to plot a specific contour line in Matlab

MOONConsider this example: X = 0:0.01:1; Y = 0:0.01:1; [x,y] = meshgrid(X,Y); z = sin(x.*y); contourf(x,y,z,'ShowText','on') The contour's values are determined automatically. How can I plot specifi contour lines with specific values like [0.1,0.3,0.44,0.63,0.78,0.89]?

User posted a question, I marked it with a dup, and User posts an answer using the information provided in the dup ... #annoyed
 
@TroyHaskin LOL
 
11:44 PM
lol
 
06:00 - 16:0016:00 - 00:00

« first day (313 days earlier)      last day (2930 days later) »