Change block "Data Type conversion" to MATLAB Function Script.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
How to Change block "Data Type conversion" to MATLAB Function Script?
0 Kommentare
Antworten (1)
Voss
am 26 Dez. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!