if statement "not enough input arguments." error

조회 수: 9 (최근 30일)
Rohit Vasu
Rohit Vasu 2021년 2월 14일
답변: Star Strider 2021년 2월 14일
Its a mapper function and i dont know where i went wrong.
function Mapper(data, ~, intermKVStore)
Healthy = 0;
Dead = 0;
Vaccinated = 0;
if data{:,:} == "Healthy"
Healthy = Healthy + 1;
elseif data{:,:} == "Dead"
Dead = Dead + 1;
else
Vaccinated = Vaccinated + 1;
end
add(intermKVStore,"Healthy",Healthy);
add(intermKVStore,"Dead",Dead);
add(intermKVStore,"Vaccinated",Vaccinated);
end

답변 (1개)

Star Strider
Star Strider 2021년 2월 14일
I have no idea what you intend, however the add function is likely not appropriate here. Consider simply concatenating instead.
Also consider using strcmp instead of the logical test for equality using ==.

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by