Change block "Data Type conversion" to MATLAB Function Script.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
How to Change block "Data Type conversion" to MATLAB Function Script?
0 Commenti
Risposte (1)
Voss
il 26 Dic 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 Commenti
Vedere anche
Categorie
Scopri di più su Data Type Conversion in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!