Cody

# Problem 8079. Create a fixed format text output

Solution 710167

Submitted on 3 Aug 2015 by Jean-Marie Sainthillier
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% x = [1.2 2.4 3.6;1.5 2.3 3.5;1.35 2.35 3.65]; n = 13; y = {13 '1:' 1.2 '2:' 2.4 '3:' 3.6; 13 '1:' 1.5 '2:' 2.3 '3:' 3.5; 13 '1:' 1.35 '2:' 2.35 '3:' 3.65}; assert(isequal(create_new_text(x,n),y))

ans = [13] '1:' [1.2000] '2:' [2.4000] '3:' [3.6000] [13] '1:' [1.5000] '2:' [2.3000] '3:' [3.5000] [13] '1:' [1.3500] '2:' [2.3500] '3:' [3.6500]

2   Pass
%% x = [1171.35 0.61 31.0 1.07 1.19 36.32 55.58 7.70 0.63 1171.72 0.62 31.1 1.07 1.19 36.32 57.80 7.72 0.63 1172.11 0.41 33.2 1.07 1.19 36.32 56.29 8.60 0.60]; n = 11; y = {11 '1:' 1171.35 '2:' 0.61 '3:' 31.0 '4:' 1.07 '5:' 1.19 '6:' 36.32 '7:' 55.58 '8:' 7.70 '9:' 0.63; 11 '1:' 1171.72 '2:' 0.62 '3:' 31.1 '4:' 1.07 '5:' 1.19 '6:' 36.32 '7:' 57.80 '8:' 7.72 '9:' 0.63; 11 '1:' 1172.11 '2:' 0.41 '3:' 33.2 '4:' 1.07 '5:' 1.19 '6:' 36.32 '7:' 56.29 '8:' 8.60 '9:' 0.60}; assert(isequal(create_new_text(x,n),y))