Change block "Data Type conversion" to MATLAB Function Script.
1 回表示 (過去 30 日間)
古いコメントを表示
How to Change block "Data Type conversion" to MATLAB Function Script?
0 件のコメント
回答 (1 件)
Voss
2021 年 12 月 26 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!