필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
Yousif Alaraji
Yousif Alaraji 2021년 12월 25일
답변: Voss 2021년 12월 26일
How to Change block "Data Type conversion" to MATLAB Function Script?

답변 (1개)

Voss
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

카테고리

Help CenterFile Exchange에서 String에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by