Created
July 15, 2015 22:09
-
-
Save morganp/6c26f4ab3d8ddbe7dc69 to your computer and use it in GitHub Desktop.
Display with auto concationation and numeric converion to strings
This file contains hidden or 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 disp2( varargin ) | |
%DISP2 Similar to disp but ... | |
% But no requirment for [] string concatination, | |
% Numerics automatically converted to strings. | |
str = ''; | |
for i=1:length(varargin) | |
element = varargin(i); element = element{:}; | |
if isnumeric(element) | |
str = [str, num2str( element ), ' ']; | |
else | |
str = [str, element, ' ']; | |
end | |
end | |
disp(str) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment