Change block "Data Type conversion" to MATLAB Function Script.

回答 (1 件)

Voss
Voss 2021 年 12 月 26 日

0 投票

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

カテゴリ

質問済み:

2021 年 12 月 25 日

回答済み:

2021 年 12 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by