« first day (630 days earlier)      last day (2582 days later) » 

7:30 AM
What made you think that adding a tag whose description starts with "DO NOT USE THIS TAG" was a good idea? — Adriaan 5 mins ago
Sometimes I love myself.
 
 
2 hours later…
9:13 AM
Looks like the 2017 developer survey results are here...
 
 
1 hour later…
10:15 AM
@Adriaan i did not understand about "DO NOT USE THIS TAG"? — kiran 3 hours ago
what.
 
MATLAB is in the list of most used technologies from the SO survey
im baffled
well it is also quite hihg in the list of dreaded languages XD
 
@Dev-iL that's a lot of web developers
I also didn't realize how old people are on SO
that's a lot of 20+ year folks
 
@excaza Were slowly becoming web developers too I'm looking at you, AppDesigner...
@excaza 40 isn't that old...
 
> ways developers teach themselves
> 80% documentation
liars
 
Sure, it's one foot in the grave, but still...
 
10:28 AM
27% SO docs?
SO must be spiking the data :)
 
> We see a relationship between job satisfaction and pushing code into production frequently. (We still see this even after controlling for other effects, such as industry.) A happy developer is a developer who can ship.
 
Yeah I saw that. Interesting
 
11:13 AM
I wonder how many times I can answer to the same person "if you use a table, this is much easier" before they use a table
I'm up to 2 :) (1, 2)
 
11:33 AM
Any bsxfun wizards around?
I'm pretty sure this can be answered with this and a reshape
@excaza Thanks a lot, but I would like to see whether the forum can help me to construct a non-loop code so that I can practically compare the loop-code with the non-loop code. — user3285148 5 mins ago
insert obligatory "this isn't a forum" here...
where's my eye roll emoji
well, at least he edited in his own attempt
 
I love these askers asking variants of the same question
too much text and too many criteria for me
 
I'm mainly annoyed because he's not even using what "the forum" has been giving him
his sample code has no preallocation, despite a question showing him how to do it
 
yeah, no, I'll let him suck the blood of somebody else
 
He keeps talking about his array sizes like they're scary big
oh no, 1000 unique indices
 
11:48 AM
Anybody mind upvoting my CW post (even temporarily) - I'm trying to game the bounty system...
I need 2 votes on it... you can remove them after the bounty is awarded :)
 
That should not be answered, but closed as too broad.
 
@Adriaan This is the secondary concery. Right now I would really hate for the bounty to go to waste
I'd say off-topic: finding a tutorial
 
12:19 PM
Hum, but its a CW, you do not get the bounty, do you?
(I am Ok if you do, just asking)
 
@AnderBiguri You do
 
OH right
 
Wouldn't be bothering anybody otherwise :)
Those of us who don't have goldmine answers gotta "make a living" somehow ;)
 
Haha it has slowed down
 
"Please would appreciate not replying with 'well you can turn this into 3 separate textscans, this is a toy example" replies with down vote
 
12:23 PM
I did get 7 upvotes today, but none the past 2 days
@Adriaan I mean, he can freaking read the docs
As a possible option to understand what he's doing
 
I guess he's not one of the 80%
 
@excaza lol
 
> Edit: I think vote-downs here are incredibly mean... leave a comment instead of just voting down like a c*, I'm asking a fair question with all of the attempts I've made at solving it...
For posterity
Side note: that attitude (last edit) will likely get you banned from StackOverflow. I highly suggest you reconsider how you respond to downvotes from the community. — Ander Biguri 2 mins ago
I highly suggest the 'community' communicates — Timo 32 secs ago
 
¬¬
 
I just want this thing just gone and I want away from these people I'm getting flamed toi hell, I cant even figuyre out why I just want out — Timo 14 secs ago
 
12:37 PM
poor lad :D
@excaza OH, IT'S A CLOSE REASON
:D
He close voted his own question xD
hilarious
 
he can't delete it with an answer
 
I know, hence the close :P
@excaza remove the tag from the title whilst you're at it
aww, he replied "well, you're wonderful", but that has already been removed :(
 
wow, that was deleted quickly
 
Wow hes having abreakdown
im not going there more, I was triying to help
 
please delete post, please leave me alone, this is not a community its a passive agressive hellhole, I just want out, my attitude is human — Timo 1 min ago
 
12:48 PM
@Dev-iL Im tempted to upvote that
 
There's more...
 
1:15 PM
@gnovice lol well when you push the rewind and fast forward buttons, that strafes left and right. Using your thumb to scroll around the wheel turns the camera. Pushing the up (Menu) button is also the forward button and opening the door. The centre button switches weapons.
Pushing the play button (down) shoots the weapon.
 
it would be fun to invent time travel even for the sole purpose of telling 90's people that you'll be playing doom on a thumb-sized portable music-player
all of that is just insane in '93
 
You unfortunately cannot move backwards. I got tripped out by that... I'd keep shooting instead of moving back so it takes getting used to.
@AndrasDeak haha yeah. The process involved installing a custom firmware build on the iPod.
 
I always died even on a PC, so I can imagine:D
 
You had to place the file onto a specific directory, then install a bootloader to force it to boot to the custom firmware.
 
well you can't expect it to be convenient to run linux on an ipod :P
or what was it
 
1:22 PM
it was actually quite easy to do lol
 
:D
amazon review: "4 stars because installing a bootloader for playing doom is a minor inconvenience"
 
Joe
Hi I have a question
 
hi, make it matlab themed and you're fine
 
Joe
ok
Bok1 is a CSV file on my desktop ,,,
% Open your file and stores the data in a matrix called variable1
variable1 = dlmread('Bok1.csv');
it gives error
 
format multiline messages as code with ctrl+k
 
1:29 PM
@AndrasDeak Suppose a bsxfun and a cell2mat get together, what would they be talkng about?
 
what error
 
@Adriaan gods I hope this is not a joke
 
does your computer explode?
 
Joe
no
Error using dlmread (line 62)
The file 'Bok1.csv' could not be opened because: No such file or directory

Error in Coding (line 2)
variable1 = dlmread('Bok1.csv');
 
@AndrasDeak I'm asking you a MATLAB themed-question :P
 
1:30 PM
@joe you need your CSV file in your current directory or use the full path to the file
MATLAB can't intuit where the file is on your computer
 
@Adriaan okay. I don't know? :D I see.
:|
 
Joe
Now I used this : variable1 = dlmread('C:\Users\ali\Desktop\New folder\Bok1.csv');
it also gives error
Error using dlmread (line 147)
Mismatch between file and format character vector.
Trouble reading 'Numeric' field from file (row number 1, field number 1) ==>
OrderDate,Region,Rep,Item,Units,UnitCost,Total\n

Error in Coding (line 2)
variable1 = dlmread('C:\Users\ali\Desktop\New folder\Bok1.csv');
 
Go read the documentation on dlmread.
But you'll want to use csvread anyway for csv files
 
@joe dlmread is for numeric data. You'll need to skip the header
 
Joe
you mean that there should no text in the csv file just numbers?
 
1:35 PM
@Adriaan csvread is just a wrapper for dlmread and doesn't solve the non-numeric issue
@joe please click on the links I am giving you
 
@Adriaan bsxfun, crying into his beer: "They call it "implicit expansion". Say it's gonna revolutionize everything. Just looks like a pink slip to me." cell2mat: "Awww, buck up pal. There's always older versions. People still use those."
4
 
Joe
ok
 
there is an explicit example illustrating how to read in files with headers
 
Joe
@excaza you are king
2
thank you bro
 
2:04 PM
http://stackoverflow.com/questions/42953103/call-function-with-n‌​ame-different-from-filename
@Joe don't thank me, thank The MathWorks :)
but you are welcome
 
OH my, still not used to my mighty power
 
2:35 PM
@Adriaan Eurozone chief (Dutch man) has some interesting comments in southern countries XD
> You can not spend all the money on drinks and women and then ask for help
LOL
 
I saw that. Bloody idiots those southerners that they want Dijsselbloem to step down. It's the painful truth that you can't keep blundering about spending money on crap whilst living on benefits from the EU. We pay, so you get your shit together, or we stop paying and leave you in the bloody dust. That's what he's saying and I agree with him.
 
What is the money spend on that you don't like?
All (literally) the money that came from EU was sent to rescue banks that did illegal stuff... Because the countries were ordered by EU to do this
I think not literally, something like 97%
At least in Spain
 
Not in Greece
 
Thing is.... Banks used this money to buy state-debt
So they are actually making money out of the rescue, and state has 0
just increased debt
@Adriaan I do not know about Greece, what are they spending the money on?
Still, a country like greece is doomed in the eurozone. They have no production, their economic system is unstable if in the same market than EU, because they will need to buy more than sell. Unless they change the economic model, but that is though
 
an inefficient, corrupt government which refuses to implement changes to counter that
 
2:46 PM
I am not very on-date with Greece tbh, but the government from a year ago did not really want more money from EU
Still, its a very bad thing to say XD
 
I don't think so, it's the bitter truth
 
Its a view of the bitter truth. Greece is also poorer because the EU
I mean, you model mathematically a country with an economy like greece and germany together, greece dies out
not sayin its not theri fault or anything
I mean, in spain it has been because corruption and extreme speculation
but EU wants the same goverment to continue because they will not prosecute bankers nor complain about massive austerity
 
Joe
ander is right ,, Greece were much more richer before joining EU .. more turists and less money to pay for gods and so one
EU is really bad
 
I do not even think that the EU is bad, very good things have come out from it
but its definitely not equally good for everyone
 
Joe
I mean the money are not enough before it was easier to live
at least euro is not effective any more
 
2:54 PM
I live in the UK and I think Brexit is an idiotic move though
anyway! sorry for the boring pooliical stuff
gottago
:D
I only want EU to go to Adriaans country to get beer TBH.
 
Joe
may be change the system of EU is better ,, like remove euro and less power in brussels
 
@AnderBiguri You're more than welcome!
 
3:29 PM
what does this even do?
0
Q: Find command in matlab, entering a number within a quotation marks

Tarun LuthraI am trying to pass a number in the find command of matlab within ' ' quotation marks Here I have this line of code v=find(a,'fldr','x ==156'); this will work if I manually enter a number next to x but instead of 156 I want to iterate this process. I save 156 as ffid. ffid = 156 v=find(a,'fldr...

 
> k = find(X,n,direction), where direction is 'last', finds the last n indices corresponding to nonzero elements in X.
interesting:D
custom-made find function?
 
it must be
but "... in the find command of matlab..."
 
@Suever, which MATLAB version?
counts=[524282; 524286; 524283; 524290];
A=randn(4,19);

t1 = timeit(@()original(counts, A))
t2 = timeit(@()original(counts, A))


function original(counts, A)
result = cell2mat(arrayfun(@(x) repmat(A(x,:),counts(x),1), 1:size(counts,1), 'UniformOutput', 0)');
end

function relm(counts, A)
result = reshape(repelem(A(:), repmat(counts(:), size(A, 2), 1)), sum(counts), []);
end
t1 =

    0.3325


t2 =

    0.3354
 
R2016b
 
in R2017a
 
3:39 PM
@excaza you're timeing the same function twice
 
oh
LOL
 
you suck
:D
 
quickly deletes all evidence
 
Hmmm
Oh hahaha
I was going to say, Just the fact that I've removed the arrayfun should make a significant difference
 
3:56 PM
well, the loop is in the middle
function result = aloop(counts, A)
result = zeros(sum(counts), size(A, 2));
idx = [0; cumsum(counts)];
for ii = 1:length(counts)
    result((idx(ii) + 1):idx(ii+1), :) = repmat(A(ii, :), counts(ii), 1);
end
end

t3 =

    0.2388
 
4:40 PM
@AnderBiguri this might call for some LaTeX wizardry, the MATLAB solution is going to be a pain in the ass
 
5:00 PM
Huh?
LaTeX what?
 
 
1 hour later…
6:15 PM
Strangely enough, I couldn't find an existing dupe for this question...
3
Q: MATLAB Merging Structs

Arthur TarasovI am trying to merge two structs with identical fields. I tried several ways, such as this and this. But it either turns out sideways or doesn't work at all. My two (simplified) structs are a(1).name = 'x'; a(1).data = 1; a(2).name = 'y'; a(2).data = 2; and b(1).name = 'x'; b(1).data = 3; b(...

Everything I found was a more complicated case.
Can anyone find a dupe? In the meantime, I started making a canonical answer to it, which links to the more complicated varieties I found.
 
I had absolutely no idea that c = [a b]; is a solution to this
makes sense
but O.o
 
horzcat is overloaded for almost every type
10
A: Why is MATLAB sensitive to order of fields in a struct array assignment?

SueverThis is likely happening because the built-in subsasgn call for the struct probably just compares the output of fieldnames (which is dependent upon field order) for the source and destination structs and does not perform any sorting prior to the comparison (likely because of the performance hit o...

Another possible issue could be a different ordering of fields
 
6:32 PM
@Suever Looks like horzcat handles that fine. The ordering of the first argument is used.
 
Oh really? That's strange
So I guess in a strange way, a(end+1:end+numel(b)) = b is actually going to be faster
Oh wait
It looks like the ordering of structs for assignment was changed in newer versions
 
I wonder if this guy is the new Masi
 
7:30 PM
@gnovice Reminds me of catstruct
 
@Dev-iL Yeah, that one's linked in the related questions.
 
7:56 PM
What is the answer ettiquete qhen tehere is litearally a docSO page explaining it?
Should I answer it? Definetly I can not dupe
 
might as well
top level example and a link to the doc for more info
 
Sure, done
 
8:31 PM
I knew this question looked familiar...!
 
@Dev-iL quite some time ago
 
I wore a suit today
 
@ballBreaker pics or it didn't happen
 
can I have a cookie
 
@ballBreaker Was it some happy event like a divorce?
 
8:34 PM
@Dev-iL a job interview at a bank
so yah, same thing
 
For a coder position...?
 
yeah
 
I think you'll find it excruciating
 
It's for a work contract
 
@ballBreaker smart, but get a different tie dork :P
 
8:36 PM
Nice. Would be considered a huge overkill in my country
 
Pretty standard here
especially for a bank
 
Here as well, but at least get a different tie
 
it looks nicer in person
Also you couldn't see my pocket square ..
In that picture
Anyways
 
@ballBreaker fancy=)
 
@ballBreaker I can't decide if you look like a young Craig Kilborn or a squeaky-clean Josh Homme. ;)
 
8:41 PM
Why is there a soap dispenser & a box of tissues on the desk in the background?
 
I'd go with whoever has "kill" in their name
 
@gnovice nice :D
@flawr some random guys desk who has a bottle of moisturizer strategically placed beside his monitors and a kleenex box..
 
9:02 PM
I thought you recently started working somewhere @ballBreaker? You already looking for a new place to poo on?
 
he got fired for playing with his switch on the toilet instead of working
 
9:22 PM
Is it common to use row vectors as loop indices in MATLAB? I don't think I ever used that...
it seems.... unsafe?
 
I've never seen it with a 2xn array before, but 1xn is common
 
You can do it but I don't particularly like it, as it is not very obvious, but basically the for loop iterates over the columns.
 
@Dev-iL I think I have at some point, though admittedly I usually use an "indexing" array of increasing integers, and index the other arrays with that
 
It is especially misleading if the number of columns is a priori unknown.
 
@beaker that's 1xn in that answer btb
 
9:25 PM
@Adriaan ah, nx1
they're column vectors
 
@beaker I think I wrote it wrong when I linked to it. My bad
 
@beaker and (faulty, don't tell Luis) transposed into row vectors, then concatenated right?
 
a 2xn loop index would be more interesting
 
wait, didn't I screw up? Isn't it 2 row vectors below one another?
 
yeah, that's what i thought ;)
@Adriaan you have led me astray
 
9:31 PM
Riddle: without running it, what would be the output of the following code (magic(2) == [1 3; 4 2]):
for ind = repmat(magic(2),1,1,2).*cat(3,1,2)
  disp(ind);
end
(Don't know why, but doing something like that reminds me of Divakar-tricks)
 
do you even need the repmat?
 
@Dev-iL I think that only works with the new implicit expansion.
 
You are both correct, but that's not the point :D
 
hm, yes it is rather odd
 
I guessed right.
 
9:38 PM
@gnovice You don't have >7k points for nothing :)
 
oh, wait... i did too, it's just that in Octave,:
>> magic(2)
ans =

   4   3
   1   2
 
flipud()
 
I thought it was giving the results upside-down
 
@Dev-iL that's near more points than I have reputation :(
 
@beaker Sounds like a bug to me.....
 
9:40 PM
@Adriaan don't feel bad, that just means he's worth at least 10x as much as you
 
why? it's valid. magic squares are not unique.
 
@beaker I thought they were trying to follow MATLAB conventions on most things
 
they should be generated by D_4 symmetry
 
@AndrasDeak I'd say more, as I am near-useless
 
@Dev-iL mmm... not so much
 
9:42 PM
I would expect the same (valid) code to give the same results on MATLAB and Octave... Which is not the case here... Which means that you can't just run the same code using the other software and get the same result
Which is worrisome...
 
your expectations are invalid:P
they are different software, and one of them is proprietary
it's a lesser miracle that octave can be as much matlab-like as it is without legal issues
 
And they just happen to be similar, right?
 
well, octave is openly a matlab-substitute-wannabe, but even their syntax is different
 
you mean the indexing-intermediate-results thing?
 
yup, and broadcasting (doesn't apply anymore), and assignments as expressions
 
9:44 PM
what's the latter?
 
all sorts of things... if... endif... # for comments... %{... %} for multiline comments...
 
(a=rand(n)(:,1)+rand(n)(1,:)) + a
I hope that works, I don't have octave installed
@beaker block comments are present in matlab
 
>> n = 5
n =  5
>> (a=rand(n)(:,1)+rand(n)(1,:)) + a
ans =

   1.27404   1.90760   2.61219   1.57969   1.09131
   1.18420   1.81775   2.52235   1.48984   1.00146
   0.56029   1.19384   1.89844   0.86593   0.37755
   1.20427   1.83783   2.54242   1.50991   1.02154
   2.03801   2.67157   3.37616   2.34366   1.85528
 
awesome, thanks
 
@AndrasDeak ah, I never ran into them
 
9:46 PM
so that line up there breaks in 3 seperate ways in matlab <2016 or something
 
yeah, lol
 
@beaker me neither, I only learned about it at university:)
 
then there's things like repelem/repelems
 
MATLAB has some use for # though
 
@AndrasDeak well, you've been there what, 25 years by now?
 
9:48 PM
all the things that Luis has been fighting getting MATL running online
 
@beaker and the whole series of Luis's self-answered Q&As ;)
ninjad by beaker
@Adriaan almost
 
I already noticed you look young for your age
 
@beaker Octave doesn't have repelem?
 
@Dev-iL they have repelems which kinda sorta does the same thing only differently ;)
 
sounds legit.
 
9:50 PM
some functions that output row vectors in MATLAB output column vectors in Octave, and on and on
 
0
A: Matlab string cell array split by delimiter to integer array

Adriaandate = {'5/13/2015 23:53';'5/13/2015 23:53'}; hour = zeros(numel(date,1); for ii = 1:numel(date) tmp = datevec(date{ii}); hour(ii) = tmp(4); end If you don't have the Finance toolbox, you can use a simple loop to extract a datevec for each date, whose fourth element will be the hour.

anyone know whether that can be done without a loop?
apparently yes
 
@Adriaan str2double(:,end-4:end-3) ? :(
 
@Dev-iL that cellfun is such elaborate overkill :P
looks fancy, but hard to debug and terribly slow
 
one can regexp the crap out of it
 
> hard to debug and terribly slow
^ would apply to regex too
perhaps not that slow...would need to try
FWIW it's a fairly simple regex
 
10:04 PM
Jake is "measuring", though I doubt he's timeiting it
@AndrasDeak it is, but that doesn't make the cellfun any better
plus, my solution uses about a third of the characters and only a single, well documented non obscure function
 
*timeingit ;)
cellfun sucks
 
his solution'd be cool if MATLAB core would not have any date functions
 
ugh... not only "a code", but "two codes"
 
uhm, what
WHAT
 
posted on March 22, 2017 by Yair Altman

MathWorks is soliciting user feedbacks about the use of Java components in Matlab programs. Related posts:FindJObj – find a Matlab component’s underlying Java object – The FindJObj utility can be used to access and display the internal components of Matlab controls and containers. This article explains its uses and inner mechanism....UDD and Java – UDD provides built-in convenienc

 
10:09 PM
the cellfun is ridiculously faster than datevec?!?
how
 
@Adriaan cause with fun everything is better=)
 
so saith Funkadelic
 
@Adriaan most likely explanation is that datevec is even more ridiculously slow than cellfun
probably uses cells under the hood
 
@AndrasDeak I suspect two things: 1) I copy the array an additional, unnecessary time, 2) datevec poops out an n-by-6 matrix, of which you need only a single column. So the entire operation is just pushing a shitload of pointless overhead, whereas the cellfun one only extracts the necessary elements
 
¯\_(ツ)_/¯
 
10:22 PM
anyhow, I got a bit of rep again (Nearing 10k!)
time to go to bed now
 
good night
you repist
 
edit datevec
 
@beaker wow, that's not pretty
 
gnite all
 
lines 1-60 are the help file, lines 61-91 are input checks, 94-141 extracts all info, and then to 422 to recheck and format the output. No wonder it's slow as hell
 
10:30 PM
check ALL the things!!!
actually, no... gonna watch sumo now :)
 

« first day (630 days earlier)      last day (2582 days later) »