if statement "not enough input arguments." error

9 visualizaciones (últimos 30 días)
Rohit Vasu
Rohit Vasu el 14 de Feb. de 2021
Respondida: Star Strider el 14 de Feb. de 2021
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

Respuestas (1)

Star Strider
Star Strider el 14 de Feb. de 2021
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 ==.

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by