« first day (361 days earlier)      last day (2869 days later) » 

11:19 AM
@AndrasDeak: Look, it's me in your natural habitat!
 
 
3 hours later…
1:57 PM
0
A: Add extra whitespace to matlab legend (for use with psfrag)

UfosThe function legend has an argument 'Location'. You can pass a vector to it, i.e. plot(1:10) legend('Sometext', 'Location', [0.20, 0.1, 0.75, 0.25]) where the latter vector can be interpreted as [Position_Right_in_pct, Position_Top_in_pct, Horizontal_Stretch, Vertical_Stretch]

^Doesn't work right?
 
 
4 hours later…
5:58 PM
@Adriaan I can imagine that the Horizontal_Stretch parameter does something tricky, but I'm too lazy to try
it not working is equally probable
@Adriaan heh lol:P
 
6:13 PM
sanity check please
@JoeC I don't have extensive experience with MEX. However, I know this: if you have to fill the whole array, you simply can't avoid allocating every element sooner or later. If you do it later, it takes much more time and it will be less efficient. I would assume your best chance is mymat(k1max,k2max)=0;, as this achieves this with minimal overhead. The real question is: what makes you think allocation is any kind of bottleneck in your application? I've never heard of such a thing, with proper preallocation. — Andras Deak 16 mins ago
OP's the one who's confused and not me, right?
he wants to pre-allocate faster than zeros(41,41)......
 
 
2 hours later…
7:53 PM
@AndrasDeak The OP has a point. There's no advantage to initializing an array to all zeros if you're going to follow that by setting every element to something else. You're setting every value twice when once will do. Unfortunately, 1) I don't know how to get around that in MATLAB, 2) Everything this OP says screams premature optimization, and 3) the time taken in reallocation is going to wipe out any performance gains over simply allocating a sufficiently large array in the first place.
 
2-3) were my thoughts
but I see their point now, thanks to you
they mean calloc vs malloc
 
yup
and it's the realloc that's gonna bite them
 
well yeah I can see how you could malloc with that mex function OP linked
it would be interesting to see if the returned matrix indeed contains gibberish in MATLAB
but I'm almost certain that OP is prematurely optimizing
they haven't realized how slow matlab is:P
 
I imagine that the hours spent optimizing this allocation will result in several seconds saved over the lifetime of the program
 
:D
a program which runs for minutes
 
 
1 hour later…
9:15 PM
Hi everyone. I want to print pretty long equations using pretty(). Do you have any clue how to fit as much as possible in one page?
I was thinking about setting output page to horizontal but I don't know how to do this
 

« first day (361 days earlier)      last day (2869 days later) »