« first day (666 days earlier)      last day (2554 days later) » 

2:25 AM
0
Q: Get subexpression strings from output of pretty() in MATLAB

honkaboyIs there a good way to get all the subexpressions in the output of a pretty() call in single-line strings? subexpr() returns a single subexpression, but I'd like to get all of them. Here's what pretty() returns: syms x s = solve(x^4 + 2*x + 1, x,'MaxDegree',3); pretty(s) / -1 ...

All I read: How can I make my job hardeasier?
 
whatever the answer, I should comment "needs more eval"
shit, half past 4
welp, good night
 
'night, sir.
 
 
7 hours later…
9:43 AM
SKM alert: Another LASSO
 
10:01 AM
@SardarUsama <facepalm>
 
 
1 hour later…
11:03 AM
OK, I have a scientific blind test for you guys
Im sending a screenshot of 2 recosntructions of teh same thing
its a zoom of a trypanosoma, a monocelular parasite od teh size of a blood red cell
I want you to shoose which image you like more
The important parameter is NOT contrast, but structural information
I want you to choose the one that seems to contain better information, regardless of the contrast
I know you have untrained eyes, but so do I
 
waffles
 
Thanks!
I'll wait for a couple of more people to answer (if they do) before telling you the difference between both
 
I'll remove my answer then so as not to influence others ;)
I can send it to you by email (or you simply click the "history" button)
 
No need for an email, this is not proper scientific test
I will at some point send my results to the experts who own the data, but I want to make sure I can actually show something that at least seems better to me. One of those images is one of ym algorithms, the other one their recosntruction.
Right know I just want untrained eye opinion, as I have bias for my work
 
 
2 hours later…
12:54 PM
@ any electrical engineer here (cc @LuisMendo for instance): in Dutch we have this thing called a "vervangingsweerstand" which literally translates to "replacement resistance". That's the thing where if you have e.g. a square with sides of resistance R the "replacement resistance" is 1/R_tot = sum(1_Ri), with Ri being R+R = 2R for the both here.
what's that called in proper English?
 
Effective resistance? Probably not jargon enough
first google hit for effective resistance: miniphysics.com/effective-resistance-resistors.html
seems legit
 
I'll just use that then. Thanks
 
Isn't it "equivalent resistance"?
@AndrasDeak opinion on that image up there? :P :P
 
Barf. Wikipedia has a page in Dutch on vervangingsweerstand, but that simply goes to "electrical resistance and conductance" in English.
 
@AnderBiguri waffles 2
I was just looking at that when you pinged:)
 
1:04 PM
Thanks!
waffles!
 
equivalent resistance sounds great too
 
I'll wait for Luis to give his electrical engineering vote. Thanks for the ideas lads
 
If it is the fact of creating a single resistance value from a circuit like this: wetenschapsforum.nl/moderator/toelatingsexamens/…
 
1 more needed
 
1:07 PM
It is definetly called equivalent resistance, or at least that is the term used around me
 
well around you are British dudes and dudettes
 
@AndrasDeak 700 more needed ;)
 
@AnderBiguri that's exactly the XKCD what this is based on :P
 
damn, anders, tell me the answer to that resistor's question
what is the equivalent resistance between those 2 nodes?
 
1:10 PM
FOOOOOM
@GameOfThrows opinion Waffles? I mean, the picture I posted up there
 
@GameOfThrows We spent almost 2 hours calculating that :P
 
lolololol and the result is?
 
R_0 (4/pi-1/2)
 
ohhhh proof for that?
 
pi?!?!
 
1:13 PM
yes
 
How, pi?
 
You're going to get a complex integral at one point.
 
Oh
This


_______



My maths down here
 
I have a PDF already if you're interested
 
1:14 PM
actually yes XD
 
It's for 3D and higher dimensional, but you can use that for the 2D case as well
 
@GameOfThrows "anders" is not present
 
lot of guys called Anders in Sweden though:)
 
my old friend named anders, so i got used to it
 
1:16 PM
@AnderBiguri eq 23 is not supposed to be there, but that's actually the one you solve in the 2D case :D
 
You have a N-dimensional solution
Like, infinite dimensional space, all filled with freaking resistors
 
@AnderBiguri I know. Eq 23 is the 2D case
 
Horror movie stuff
 
I was trying to solve the 3D case, but got a bit stuck (obviously), so went to my teacher and he told me I was doing a wrong exercise :P
 
@Adriaan Hm. I studied that in Spanish. We say "resistencia equivalente", which you can guess what it measn :-) But I'm not sure if in English it's "equivalent resistance"
 
1:19 PM
Once I went to a conference where some guys where presenting "a new way of solving FEM for electricity". They went and say "loook, we do not udnerstand how FEM works, so instead , we actually built a mesh of resistors with the shape and resistivity of what we want to solve and we put electricity on it. It works!"
Everyone facepalmend
 
@LuisMendo well, I'll just call it that and hope my teacher understands
 
Wikipedia contains "Thevénin equivalent", so I guess it's safe to say "equivalent resistance"
 
Yes, I used to call it Thevenin indeed
But I got confused with the Norton Thevenin etc and I just moved to equivalent
I thinke veryone did
 
They say "equivalent resistance" here. I don't know if they are native speakers, though
 
@AnderBiguri do you understand the reasoning in my file a bit?
 
1:22 PM
Nope, but I do not have time now to actually spend more than 3 mins
I will at some point
I think I can get to Green, then who knows
 
@AnderBiguri I think I see more "details" in the left one
 
Now comes the point he tells us we all failed the test
 
Hahaha
ther eis no good or bad
The right one is what they use nowadays
left one is my algorithm :D
In total, 5v3 in favour of left
Still, the right one has contraast enhancement etc and the left has no posprocessing techniques so I can improve more
but im happy you chose left :D
 
You predisposed us when saying "regardless of contrast" :-P
 
at least I gave more of a reasoning
 
1:26 PM
Hahaha, but if I do not say that, then you would most likely have chosen right
and contrast is non-relevant, because it is just plotting/scaling
 
No I wouldn't, see the reasoning :P
 
@Adriaan :D :D That is what I though indeed, the same as you
 
0
Q: Creating a matlab function that list books

Tee Iani created a function: function display_book(x) [a,b] = strtok(x,',') ; [b,c] =strtok(b,','); b=strrep(b,',',' '); c=strrep(c,',',' '); fprintf('Title : %s \n',a); fprintf('Author :%s \n',b); fprintf('Number of pages :%s \n',c); end It basically shows the title author and number of pages of a ...

where'd we see this earlier this week again?
ah, it's the one of Excaza's brilliant screenshot. That one has been removed no?
Yup. New post, but better readable this time.
 
Thanks all for the opinions in the image :D
 
("and for choosing my image")
 
1:37 PM
:P
I sitll need to work hard on this, but I think I can improve their whole research field by just running better maths
I hope I can :D
 
Better maths is always a good idea :-)
 
My best friends whole PhD has been extracting information from those images XD. I hope I dont make his PhD obsolete
 
What's it called again when you have a mathematical thing like (n-2)*(n-1)*(n)?
 
"Using an extensive survey involving highly intelligent people we may conclude that our novel image reconstruction technique is superior, so neener neener"
3
 
@AndrasDeak That will be the conclusions of the study indeed
 
1:45 PM
@AndrasDeak and 1 geologist :D
 
collateral damage:D
@Adriaan n!/(n-3)! but that's probably not what you mean
permutation with repetitions?
that's the "how can the first 3 contestants be ordered when there are n contestants" problem
 
@AndrasDeak I already wrote some functioning MATLAB code. It just looks ugly :P
 
prod(n-2:n)?
 
steps = ii/2;
tmp = ii*ones(1,steps)-(0:steps-1);
PtArray = cumprod(tmp);
at least I now got the equivalent resistance of N dimensional hypercubes, with N arbitrarily large :P
 
I can't decypher that right now but my hunch is that you're overcomplicating it
 
1:51 PM
probably. But I get the correct results :P
 
that's fine:)
 
yea, I don't even need this, it's just for show
nvm, I suck, once agaibn
 
@Ander you were interested a bit in our internal affairs; here's a relevant video from the European Parliament :D
 
@AndrasDeak ah, the guy with bad teeth, a bad feeling for Walloon, but love for Flanders and the EU :D
"Burning books on the square before parliament?" nazi references, check.
Proper speech. I like it.
 
that part is a bit exaggerated, but much less so since the university has been killed
 
has the CEU already been closed?
I know the law has been accepted, but have they gone through already
Do you have Orbán's reaction to this @AndrasDeak? Preferably in a language I can understand
 
2:33 PM
@AndrasDeak "I didnt say it in french <suggestng that then the french woudl not understand>"
BURN
Interesting video
 
@AnderBiguri as I said: he's not very fond of Walloons in his country
 
I probably don't agree with him completelly (in other thigns, hes right on this), but interesting speech indeed
NExt suggested video is Nigel Farage talking to him
Fucking Farage
 
there's the 90mins Hungarian report on the full discussion by all parties
but my Hungarian is a tad rusty
 
user6845426
3:07 PM
Hi guys :)
 
Hi
 
user6845426
o/
 
@AnderBiguri #1 - the details of the boundaries are blown out in #2
 
user6845426
3:55 PM
I have some data trnLabel of shape 10000x1 which holds a single integer value 0-9. How would I go about reshaping its data to 10000x10 where each holds a vector of 0's with a length of 9?
 
@dipper are you trying to do one-hot encoding?
i can't visualize what you're trying to do
 
@dipper the new matrix, is a binary matrix?
@beaker :D yeah
 
user6845426
I'm not sure what that is so i'm going to go with no. I've got some image data (sub-set of Ciphar-10) that I need to classify. So i've got a patternnet but the labels should be in vectorised form
 
WEll, thats what I think XD
@dipper Iyou can not create a matrix 10 times the size without more information
So what are you missing in your description?
Binary matrix: matix that has either 0 or 1
 
user6845426
Yeh binary
 
4:04 PM
@dipper can you give us a sample row of the resulting vector?
for trnLabel(1) = 7, for example?
 
user6845426
Yeah
 
So [3; 5] is [0 0 0 1 0 0 0 0 0 0;0 0 0 0 0 1 0 0 0] ?
 
user6845426
yeh
 
user6845426
I've got this
 
user6845426
for i = 1:10000
    output = [0 0 0 0 0 0 0 0 0];
    output(trnLabel(i,:)) = 1;
end
 
4:07 PM
okay, that's one-hot encoding...
 
user6845426
Oh, apologies
 
102
Q: Using i and j as variables in Matlab

Shaii and j are very popular variable names (see e.g., this question and this one). For example, in loops: for i=1:10, % do something... end As indices into matrix: mat( i, j ) = 4; Why shouldn't they be used as variable names in Matlab?

 
full(sparse(1:10000,trnLabel+1))
that should work
 
@beaker or just leave it sparse. Who cares about zeros anyway
 
yeah, since only 1/10 of the values are 1
alternatively, you could use sub2ind
there should be a dozen or so questions on SO
this one, for example:
1
Q: Create a zeros filled 2D array with ones at positions indexed by a vector

MuffoI'm trying to vectorize the following Matlab script: Given a column vector with indexes, I want a matrix with the same number of rows of the column and a fixed number of columns. The matrix is initialized with zeros and contains ones in the locations specified by the indexes. Here is ...

 
user6845426
4:10 PM
Thanks for your help :)
 
user6845426
Oh I like this yvec = bsxfun(@eq, 1:9,y)
 
user6845426
:)
 
everyone likes bsxfun
 
it has fun right in the name!
 
@Divakar Congrats already!!
4
 
4:24 PM
woohoo! \o/
 
dude's got 7 gold tag badges. Wow
 
4:40 PM
Thanks Luis! :)
Loving those implicitly expanded zeros along the trailing dimensions of the rep!
 
Congrats @Divakar !
 
Thanks mate! @SardarUsama
 
> I have a swarm of robots
That sounds scary!
@Divakar Haha
@Adriaan And is only held by other five people :-O Including Jon Skeet
 
Yup, that's one of the best badges!
 
Impressive!
 
4:51 PM
@LuisMendo wow, the top user list of that tag is littered with people getting thousands and thousands of rep for a single question
 
Yup that guy is a hot-shot one @Adriaan
 
@Divakar there's actually quite a few people with answers that much upvoted
 
@Divakar Funny how only you and I have the gold tag. I thought matrices were popular?
 
yeah they should be I thought so too Luis
But I guess they call it arrays in other languages
 
@Luis and @Divakar :
3
 
4:53 PM
hahaha
 
Hehehe. Now which is which?
 
good question!
You gotta get the vectorization silver badge Luis!
 
Speaking of that... you are the first and only to have the gold tag! :-O
The matrix StackOverflow has you
 
haha or the matrix of SO has us!
 
:-)
 
4:58 PM
ah I gotta ask you about Jelly the CG language
 
Hm. I know very little about that language. I answered a couple of times with it
 
I was looking at it , it seemed like motivated or has pieces from NumPy. Is that true?
In the requirements of it, it says it needs NumPy
 
Dennis wrote it in Python. The compiler uses Numpy (and SymPy I think, or whatever it's called). And yes, I think some functions are inspired by Numpy
 
I see
 
But I don't know enough Jelly or Numpy
 
5:00 PM
hmm looked interesting, thanks for the inputs
 
Hope to see you around in PPCG too! :-)
 
haha still not there yet to participate ;)
 
Oh, there's also Pyth, inspired directly by Python
And its docs are very complete
 
yeah I know, looked at it, but not long enuff :)
 
Same here :-)
 
user6845426
5:37 PM
I'm trying to read up on patternet but I couldn't really get much info from the docs. uk.mathworks.com/help/nnet/ref/patternnet.html Am I looking in the wrong place?
 
What info are you looking for?
There is a lin in the bottom with a nice tutorial
 
oh you UK maths guys :P
 
user6845426
oh nice thanks. I'll take a look
 
why does mathworks add the location to the URL anyway?
 
No idea
NSA
I assume
 
5:40 PM
Delete the mathworks cookie and startover with the .com(US) domain
 
The spyonage Toolbox, in R2018a will be revolutionary
 
But I don't want to be in the US :( They cna't spell properly
 
@Adriaan that's where you get the localized version of MATLAB that spells "color" "colour"
but apparently they don't want to let you in ;)
 
@Adriaan EH, Bad spelling is not unique to the US! I also can do it!
 
@beaker Quickly sets up a VPN
I got overly excited from the "Queen's MATLAB" post of 1 April last year
 
5:46 PM
@Adriaan we should totally write that and put it up on github... just write aliases like colourmap.m ;)
it would make all code from the UK completely un-portable :)
 
shouldn't that be un-pourtable instead for UK
 
no, "portable" comes from French, so they spell is sensibly
>:D
 
@beaker I have philosophised about creating a "proper English toolbox" to do all that in one go :P
 
ok :D
vectorized "proper English toolbox"!
 
vectorised* that'd be :p
 
5:49 PM
I like the Z's, they have zing!
like the metal zinc
 
who are we sinking? :P
 
nonono, that means "think"
 
"What are you sinking about?"
This is an official ad in Germany to get people to learn proper English :D
 
haha yeah that's the video for "thinking"
 
:D
 
 
1 hour later…
6:55 PM
Why you should not use pie charts:
(via MaxCRoser)
 
congrats @Divakar! :)
 
Thanks Mr Deak!
Those annoying .x k rep is past
 
hehe:)
boss-mode enabled
did you get a swag notification?
 
haha no I mean seriously like 50.2k .. comeon!
give me 50k or 51k
yeah got an email, that I gotta fill up, not yet done
 
woooh :)
 
7:05 PM
yup!
 
Ah, so that's quick! Great
 
yeah got on 26th April, was auto-generated I bet
 
Allow 6--8 weeks, ya know...
 
yeahh ..
not a coffee guy myself, but whatever, I can't choose anything else AFAIK
 
I have never used that mug for anything other than decoration :-)
Do you know gnovice chose the "code snippet" on it?
 
7:09 PM
haha sure!
 
@Divakar you can always use it for other liquids, or even as a plant pot\
 
as in the code on the mug was written by gnovice? @Luis
 
^^ Whiskey on a mug? Nah
@Divakar Yup- Let me find it, he said that here
 
More of a milkshake guy, so maybe that
but a bit small for that prolly
 
@LuisMendo whisky in the jar ;)
 
7:11 PM
Haha. Which version do you prefer? The original or Metallica's? (I'm torn)
 
I don't think I even know the original
 
onebox onebox onebox!
 
@Adriaan You should. It's quite good. Not as "metal" of course
I mean Thin Lizzy's
Not really "the original", as it's a traditional song I think
 
@LuisMendo Ah sweet! Well he made contribution into the code it seems!
 
7:15 PM
@Divakar I thought up the sportsmanship badge and the names for the bounty badges. One of those got me a t-shirt, if I recall.
 
you da real mvp, gnovice:)
 
@gnovice And the code was also yours, isn't it? Or did I get confused?
On the mug, I mean
 
@LuisMendo Yep
 
haha the maker of the badges!
 
^^ You must be proud :-) Best SO users have that mug with your code!
 
7:18 PM
@LuisMendo Yeah, it's my small claim to SO fame.
From back in the day when I was much more active on Meta.
 
so what is Jon Skeet getting for 1M rep?
 
^^ That, and a couple answers here and there :-P
@Divakar An overflow back to 0. Yay!
 
haha We wish dont we!
Well he deserves a mug with some amazing code
 
I would really like a T-shirt with bobince's "The pony" answer
But then again, I wouldn't have the courage to wear it
 
@gnovice we got ourselves a celebrity on our hands
 
7:22 PM
On our pincers
 
@ballBreaker Celebrity may be too strong. Maybe more like former child star.
@LuisMendo I think I've worn mine once, and that was just around the house.
 
@LuisMendo "best" or "java dupe answerers"
 
7:35 PM
@LuisMendo hehe
 
7:59 PM
7
A: Prevent MATLAB from opening pool

AdriaanUnder Home->parallel->parallel preferences you can deselect the check box "Automatically create a parallel pool (if one doesn't already exist) when parallel keywords are executed." This makes all the parfor loops behave as a normal for loop. I'll get back to you if I figure out a way to do this ...

just got another random upvote on that. It still irks me though that the other two answers are even less correct than mine.
Dennis' answer is plain incorrect, Robbert's is now approximately the same as what I had before, though he wrote it in text and I used code
 
I've got a question for you guys stemming from Ray's answer here...
5
A: How can I detect the mouse position anywhere on the screen?

rayryengAre you sure MATLAB can only get the mouse co-ordinates within a GUI? It's actually quite simple to get the position of your mouse anywhere on your screen, independent of a GUI. Use the following: get(0, 'PointerLocation') Try this by moving your mouse around and invoking this command each t...

I had a thought that alternatively you could create a listener for the 'PointerLocation' property of the root object that would evaluate every time the mouse moved, but it doesn't do anything at all.
I tried this:
listenObj = addlistener(0, 'PointerLocation', 'PostSet', @(~, ~) disp('hi'));
No errors, it just doesn't evaluate ever. I'm in R2016a. Does this work for you guys?
 
no error: no problem
sorry, not in front of a gui-ish matlab right now :(
plus I've got old matlab installed
 
 
2 hours later…
9:46 PM
@gnovice Same on R2015b: no errors, no action.
First time I see @(~, ~) syntax :-)
 
show-off replacement for @(varargin) :P
Luis engaged self-destruct
 
:-D
 
that was a lot of clicking on "history". It's good to be a room owner.
 
10:19 PM
14
Q: Brief outage planned for Wed, May 3, 2017 at 0:00 UTC, 8pm US/Eastern (like a fire drill for computers)

Tom LimoncelliMicroVersion: Planned service degradation: All Stack Overflow/Stack Exchange sites read-only for 20 minutes on Wed, May 3, 2017 shortly after midnight UTC (8PM US/Eastern). If you blink, you'll miss it. Short version: There will be a service degradation for up to 20 minutes shortly after midnig...

 
10:43 PM
Do we have a duplicate for questions like this?
-1
Q: How to store the data from each iteration?

Pritchfor q1 = [0:.1:20] ss = fsolve(@SS1,[-.0004,.001],[],q1) end How do I store SS as a matrix and have it store the data from each iteration?

 
@SardarUsama I'm sure there are dozens. I don't know if there's a good canonical dupe.
 
Every other day, we have a question like this
 
I would guess that this would be something that Documentation ::shudder:: is supposed to cover.
 
@beaker You mean like SO MATLAB doc?
 
11:03 PM
yeah, that thing
 
I thought we agreed never to speak about it :P
 
I still can't believe it's even a thing though :P
 
You'll notice I didn't offer to go check :P
 
11:43 PM
> thing
:-)
 
are u sure?
;)
 
MATLAB has a video for that. But that uses i as a loop variable and doesn't pre-allocate. That's a very unexpected thing from MATLAB :/
 

« first day (666 days earlier)      last day (2554 days later) »