Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
fmt='%.3f';
v=[-3.1416 -1.5708 0 1.5708 3.1416];
c_exp={ '-3.142' '-1.571' '0.000' '1.571' '3.142'};
assert(isequal(vector2formattedstringCA(fmt,v),c_exp))
x =
'-3.142' '-1.571' '0.000' '1.571' '3.142'
|
2 | Pass |
fmt='%.6f';
v=rand(1,5);
c_exp={};
for data=v
c_exp{end+1} = sprintf(fmt,data);
end
assert(isequal(vector2formattedstringCA(fmt,v),c_exp))
x =
'0.406907' '0.364484' '0.716139' '0.807801' '0.044088'
|
3 | Pass |
fmt='%i';
v=rand(1,10)*100;
c_exp={};
for data=v
c_exp{end+1} = sprintf(fmt,data);
end
assert(isequal(vector2formattedstringCA(fmt,v),c_exp))
x =
Columns 1 through 5
'3.646086e+01' '9.019308e+00' '6.140632e+01' '5.528292e+00' '5.765693e+01'
Columns 6 through 10
'4.956342e+01' '3.961963e+01' '8.754471e+01' '1.099830e+01' '8.146538e+01'
|
given 3 sides, find area of this triangle
680 Solvers
202 Solvers
Back to basics 19 - character types
225 Solvers
228 Solvers
Sum the 'edge' values of a matrix
232 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!