Display cell array without quotes - MATLAB -
i have cell array in matlab named outstr. of elements strings. when try display array, every string comes between quotation marks this:
>> outstr outstr = 'a' 'b' 'fa' 'fb' 'xn' 'fx' 'sign fa*fx' '0.70000' '0.90000' '-0.19592' '0.33887' '0.77327' '0.02896' '-' '0.70000' '0.77327' '-0.19592' '0.02896' '0.76383' '0.00206' '-' '0.70000' '0.76383' '-0.19592' '0.00206' '0.76316' '0.00012' '-' '0.70000' '0.76316' '-0.19592' '0.00012' '0.76312' '0.00000' '-' how display array without quotations?
something might meet needs -
%// input outstr ={ 'a' 'b' 'fa' 'fb' 'xn' 'fx' 'sign fa*fx' '0.70000' '0.90000' '-0.19592' '0.33887' '0.77327' '0.02896' '-' '0.70000' '0.77327' '-0.19592' '0.02896' '0.76383' '0.00206' '-' '0.70000' '0.76383' '-0.19592' '0.00206' '0.76316' '0.00012' '-' '0.70000' '0.76316' '-0.19592' '0.00012' '0.76312' '0.00000' '-' } outstr1 = strcat(outstr,{' '}); %// add whitespace %// convert char array outstr_char = char(outstr1{:}) %// size parameters [m,n] = size(outstr1) p = size(outstr_char,2) %// reshape + permute magic create %// char array "replica" of input cell array out = reshape(permute(reshape(outstr_char.',p,m,[]),[1 3 2]),n*p,m).' %// display char array disp(out) sample run -
>> outstr outstr = 'a' 'b' 'fa' 'fb' 'xn' 'fx' 'sign fa*fx' '0.70000' '0.90000' '-0.19592' '0.33887' '0.77327' '0.02896' '-' '0.70000' '0.77327' '-0.19592' '0.02896' '0.76383' '0.00206' '-' '0.70000' '0.76383' '-0.19592' '0.00206' '0.76316' '0.00012' '-' '0.70000' '0.76316' '-0.19592' '0.00012' '0.76312' '0.00000' '-' >> disp(out) b fa fb xn fx sign fa*fx 0.70000 0.90000 -0.19592 0.33887 0.77327 0.02896 - 0.70000 0.77327 -0.19592 0.02896 0.76383 0.00206 - 0.70000 0.76383 -0.19592 0.00206 0.76316 0.00012 - 0.70000 0.76316 -0.19592 0.00012 0.76312 0.00000 -
Comments
Post a Comment