« first day (858 days earlier)      last day (2375 days later) » 

3:03 PM
Is there a way to apply an cellarray of functions to an argument?
similar to cellfun, but the other way around:)
(and no funcell doesn't work)
 
I think you can do this with cellfun + feval
funcs = {@sin, @cos, @tan};
arg = pi/3;
cellfun(@(x)feval(x,arg),funcs)
ans =
    0.8660    0.5000    1.7321
 
oh that is clever! thanks a lot!
 
np
@flawr This also works: cellfun(@(x)x(arg),funcs)
 
@Dev-iL ah yes, I just noticed:)
there is a reason this is called functional programming
XD
@Dev-iL I just found the function deal() :)
 
Oh I know deal :)
 
3:15 PM
really cool=)
 
Jan 27 '16 at 11:07, by flawr
Why did no one ever tell me about deal???? — flawr 37 secs ago
 
oh god
 
3:31 PM
why do I keep forgetting about stuff like that?
 
@flawr That's just how learning {languages} works - first time you encounter a word you'll remember it for a few hours, then for a few days, then weeks.... then you practically know it :)
 
4:27 PM
that happens sometimes, but this was an instance where I was pretty sure I've never seen it before :)
 
@TobiasK Why did you come to the room? Are we known to give free upvotes?
 
user7222571
no i just went to a random room
 
Zoe
@Dev-iL Mod flag it, it's in multiple rooms. (it's a request for vote fraud on questions)
 
@TobiasK Gee, thanks for that, it makes me feel special. :) I don't see anything wrong with your English, perhaps it's your questions that need improvement.
 
4:53 PM
@Dev-iL I think we are better known for giving free downvotes.
 
@flawr Indeed, life is hard and thankless in the tag....
 
 
1 hour later…
6:05 PM
hey dudes...how would you fill a vector with the different powers of 2...e.g. [1 2 4 8...
 
2.^(0:n)
 
many thanks :D
 

« first day (858 days earlier)      last day (2375 days later) »