Rank: 2129 based on 68 downloads (last 30 days) and 3 files submitted
photo

Emile Demarteau

E-mail
Lat/Long
51.44699, 5.48882

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Emile View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
08 Apr 2011 Read diadem file Read NI Diadem files into Matlab. Designed for use with files using the Block store method Author: Emile Demarteau import, read, diadem, r32, dat, data import 21 0
15 Feb 2011 Screenshot Coffee Roulette Let Matlab decide whose turn it is to get the coffee. Author: Emile Demarteau dojo, json, coffee, coffeeroulette, random 21 0
26 Nov 2009 Screenshot Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau latex, laprint, print, documents, export 26 12
  • 5.0
5.0 | 4 ratings
Comments and Ratings by Emile View all
Updated File Comments Rating
29 Nov 2010 FileTime Get and set the times for creation, access and modification of a file or folder (Windows only) Author: Jan Simon

Dear Jan,

Your function looks really promising, however I cannot compile the function, as matlab returns an error on the TzSpecificLocalTimeToSystemTime function. I am running matlab 7.5 on XP so this should support this functon.

Alternatively I commented out the error warning which uses this function. Now compilong works, however the function still return an error: 'SetFileTime: Time to FILETIME failed!' or ''Too many input paramters"

Finally, your precompiled dll's fixed the problem.

So thanks for putting this online!

Cheers,
Emile

22 Sep 2010 Save Entire Command History Maintains a complete record of the command history (Matlab only maintains the last 20k worth ... Author: Jonathan Snell

Thanks for this great contribution! I was looking for this functionality, and it works great!

@Eric I got around the error problem in finish.m by placing the history_preserved command in a try cath block. So finish.m will look like:

setpref('StartupDirectory','LastWorkingDirectory',pwd)
try
preserve_history;
catch EM
h=msgbox(EM.message,sprintf('Error: %s',EM.identifier),'error');
uiwait(h);
return
end

Now it won't 'hang' your matlab but just display an error dialog before closing.

07 Jul 2010 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau

Hi Pascal,

I had a similar problem. Matlabs legend command does not really have correct positioning properties if the legend is outside the figure. I added some lines below the legend2latex function to adjust the position properties manually

legend2latex(fig1);
legendstr_h = findobj(gca,'Tag', 'legend2latex_text');
xlim_ax1 = get(gca,'XLim'); ylim_ax1 = get(gca,'YLim');
set(legendstr_h, 'Position', [min(xlim_ax1)+1.7*range(xlim_ax1), 1.0125*max(ylim_ax1) 0]);

hope this helps.
Cheers, Emile

28 Oct 2009 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau

Hi Diane,

See below for an example of how this file can be used. I noted that the figure_handle is different from the figure_handle as expected by LaPrint. I use a direct handle, where LaPrint uses the figure number.

Good luck,
Emile

%%%%% EXAMPLE %%%%%%
set(0,'defaulttextinterpreter','none');
x = [0:0.1:(2*pi)];
fig1 = figure(1);
plot(x,sin(x),x,cos(x));
legend('sin($\theta$)','cos($\theta$)');
xlabel('$0 \leq \theta \leq 2\pi$')
legend2latex(fig1);
laprint(1,'figure1');

30 Sep 2009 LaPrint LaPrint prints a MATLAB figure to file for neat inclusion in LaTeX documents. Author: Arno Linnemann

Great work! This script allowed me to perfectly markup all my figures, so they could be included nicely in my report. @Tor Aksel, I wrote a legend to latex converter to overcome the small box problem.

Comments and Ratings on Emile's Files View all
Updated File Comment by Comments Rating
16 Oct 2013 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau Philipp

I'm trying to use legend2latex for a bar-graph, but I get the following error:
ans =
flat

Subscripted assignment dimension mismatch.

Error in legend2latex (line 91)
patchColor(i,:) = get(ud.handles(i),
'FaceColor');

I hope you can help me!
Thanks!

16 Aug 2012 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau Anthony

Very nice function! I found another bug - it doesn't place the legend properly for axes that have a log scale. To fix this:

First determine whether the axes have a log or linear scale. I did this with:

axes_handle_var = get(figure_handle,'currentaxes');
x_axis_scale = get(axes_handle_var,'xscale');

If the scale is logarithmic then the code in 'legend2latex.m' around line 239 must be changed to:

legendx = (min(get(plots(1),'XLim')))^(1-legend_percentual_x) * (max(get(plots(1),'XLim')))^(legend_percentual_x);

It would be best to use an 'if' statement to properly place the legend for both scales. Change the 'ylegend' code in a similar way.

25 Apr 2012 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau Tor

Really nice function. However, the font size in the legend is not preserved. This is easy to fix with something like
fontsize = get(legh,'FontSize');
...
set(legend_lbl, 'FontSize', fontsize);

Moreover, the script does not check for horizontal orientation of the legend. This is a little more involved to fix, but I have a quick and dirty fix if anyone wants it.

In my opinion, this function works even better if used with matlabfrag instead of laprint.

28 Apr 2011 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau Henc

In order to use this with pentagrams, the following line needs to be added within the 'pentagram' and 'p' cases:
markers_edge{i} = '\large{$\bigstar$}';

Otherwise, the symbols fail to show up in the legend.

20 Jul 2010 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau David

This solution works perfectly for me combined with laprint, but whenever I include legend2latex i lose the marker information stored within the legend.

For reference this is what I am using,

util1 = figure;
plot(sense_times, ut, '-*b', 'LineWidth', 1);
hold on;
plot(sense_times, ut_g, '-or', 'LineWidth', 1);
legend1 = legend('Local Util.', 'Global Util.', 'Location', 'SouthEast');
%set(legend1, 'Box', 'off');
%set(legend1, 'Color', 'none')
xlabel('Sensed Frequencies');
ylabel('Utilization');
title('Frequency Utilization (PU Activity = 0.2)');
grid on;
figfontsizes(11,9);
legend2latex(util1);
% legendstr_h = findobj(gca,'Tag', 'legend2latex_text');
% xlim_ax1 = get(gca,'XLim'); ylim_ax1 = get(gca,'YLim');
% set(legendstr_h, 'Position', [min(xlim_ax1)+1.7*range(xlim_ax1), 1.0125*max(ylim_ax1) 0]);
laprint(gcf,'util1','width',11,...
'asonscreen','off','keepfontprops','off',...
'factor',1,'scalefonts','off','mathticklabels','on');

Contact us