Commit 2b11ed86 authored by Markus Mueller-Trapet's avatar Markus Mueller-Trapet

bugfix for num2str function

parent dd656b87
......@@ -92,17 +92,17 @@ classdef itaValue
end
%% *********************** conversions *****************************
function res = num2str(a,varargin)
function res = num2str(this,varargin)
% convert to string with value followed by unit string
if length(a) > 1
if length(this) > 1
res = [];
for idx = 1:length(a)
res = [res ' ' num2str(a(idx),varargin{:})]; %#ok<AGROW>
for idx = 1:length(this)
res = [res ' ' num2str(this(idx),varargin{:})]; %#ok<AGROW>
end
else
res = num2str(a.value(:),varargin{:});
if ~isempty(a.unit)
res = [res , repmat([' ' a.unit],numel(a.value),1)];
res = num2str(this.value(:),varargin{:});
if ~isempty(this.unit)
res = [res , repmat([' ' this.unit],numel(this.value),1)];
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment