Last active
May 22, 2017 20:47
-
-
Save Arth-ur/03f102fdf0ece129f83559eab621a988 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function kvf2tex2( kvf, fout, rootkey) | |
%KVF2TEX2 | |
if nargin > 1 | |
rootkey = [rootkey '.']; | |
else | |
rootkey = ''; | |
end | |
TEMPLATE = '\\@lookupPut{%s%s}{%s}\n'; | |
hfout = fopen(fout, 'w+'); | |
fprintf(hfout, '\\makeatletter\n'); | |
fields = fieldnames(kvf); | |
for i=1:numel(fields) | |
fprintf(hfout, TEMPLATE, rootkey, fields{i}, kvf.(fields{i})); | |
end | |
fprintf(hfout, '\\makeatother\n'); | |
fclose(hfout); | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function kvfprint( kvf ) | |
%KVFPRINT Print structure | |
fields = fieldnames(kvf); | |
for i=1:numel(fields) | |
fprintf('%s = %s\n', fields{i}, kvf.(fields{i})); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment