Problem 1262. Convert elements in numeric array into different class
Write a function that converts elements in a numeric array into a different class. Example:
a = [1:5]; % class: double
b = convertto(a,'uint32');
b =
1 2 3 4 5
class(b) ans = uint32
Solution Stats
Problem Comments
-
1 Comment
James
on 11 Feb 2013
No str2func allowed? Pity...
Solution Comments
Show commentsProblem Recent Solvers59
Suggested Problems
-
2414 Solvers
-
Project Euler: Problem 2, Sum of even Fibonacci
2815 Solvers
-
342 Solvers
-
98 Solvers
-
Replace all zeros and NaNs in a matrix with the string 'error'
103 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!