- refactored
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
%-------------------------------------------------------------------
|
||||
%
|
||||
% [l]=lge(x);
|
||||
%
|
||||
% alias fuer length(x): l=max(size(x));
|
||||
%
|
||||
%-------------------------------------------------------------------
|
||||
|
||||
%
|
||||
% author: Markus Hofbauer,
|
||||
% ISI, ETH Zuerich (Switzerland)
|
||||
%
|
||||
% created: 7/2000
|
||||
%
|
||||
%-------------------------------------------------------------------
|
||||
|
||||
function [l]=lge(x);
|
||||
l=max(size(x));
|
||||
@@ -0,0 +1,24 @@
|
||||
function print_parameters(params, units)
|
||||
align = 32;
|
||||
names = fieldnames(params);
|
||||
for n=1:length(names),
|
||||
if isempty(params.(names{n}))
|
||||
continue;
|
||||
end
|
||||
fprintf('%s', names{n});
|
||||
remain = align - length(names{n});
|
||||
if remain < 0
|
||||
error('Invalid variable length!');
|
||||
else
|
||||
for j=1:remain
|
||||
fprintf(' ');
|
||||
end
|
||||
typeName = typeinfo(params.(names{n}));
|
||||
if typeName == "scalar"
|
||||
fprintf('= %g %s\n', params.(names{n}), units.(names{n}));
|
||||
else
|
||||
fprintf('= %s\n', typeName);
|
||||
end
|
||||
end
|
||||
end
|
||||
endfunction
|
||||
Reference in New Issue
Block a user