Change block "Data Type conversion" to MATLAB Function Script.
Afficher commentaires plus anciens
How to Change block "Data Type conversion" to MATLAB Function Script?
Réponses (1)
Voss
le 26 Déc 2021
Something like this?
function out = convert_type(in)
if ischar(in)
% convert character array to numeric array
out = str2num(in);
elseif isnumeric(in)
% convert numeric array to character array
out = num2str(in);
else
% unsupported type
out = in;
end
end
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!