if statement - working with characters
82 views (last 30 days)
Show older comments
I am executing the following code:
x = inputdlg({'Month', 'Population renewal', 'Death rate'}, 'Inputs')
f = getfield(x,{1});
if (f == 'January')
b = 0.5
else
b = 0.7
end
and I am getting an error that says "??? Undefined function or method 'eq' for input arguments of type 'cell'"
Please do tell me where I am going wrong....
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!