Context:
Currently, I have a map of my data where each key will have a value that is incremented, or if the key does not - it will create it - this works fine.
Problem:
However, when trying to plot via
plot(keys(map),values(map));
this results in "Error using plot, not enough input arguments"
Code Example:
map = containers.Map({1},{0});
for i=1:10
keyExists = isKey(map,i);
if (keyExists == 0)
map(i) = 0;
end
map(i) = map(i) + 1;
end
plot(keys(map),values(map));
Output Example:
>> keys(map)
ans =
1×10 cell array
{[1]} {[2]} {[3]} {[4]} {[5]} {[6]} {[7]} {[8]} {[9]} {[10]}
I don't quite understand where the problem lies.
keys(map)output ? Please create a reproducible example, add the minimal code needed to reproduce your problem.cell2mat()function allows plotting:plot(cell2mat(keys(map)),cell2mat(values(map)));