Change block "Data Type conversion" to MATLAB Function Script.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How to Change block "Data Type conversion" to MATLAB Function Script?
0 commentaires
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
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!