Problem 1973. Reassign cell contents to empty variables, preserving cell content data type
Given a cell array C, return a cell array D with the following specifications:
1. D has the same size as the input C.
2. Each cell of D contains an empty (0x0) variable, the data type of which must match the data type of the original contents of the cell.
Examples:
1. If C = {1, 2; zeros(2, 'single'), 'ABC'} then D = { [], []; zeros(0, 'single'), ''}.
2. If C = {true, rand(2), 'MATLAB'} then D = {true(0), [], ''}.
Note: cell arrays in the test suite only contain data types present in core MATLAB.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers18
Suggested Problems
-
Omit columns averages from a matrix
606 Solvers
-
Back to basics 22 - Rotate a matrix
922 Solvers
-
Sum of first n terms of a harmonic progression
473 Solvers
-
Given a matrix, return the last eigen value
228 Solvers
-
Test if two numbers have the same digits
253 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!