Possible erroneous lint message when using SPRINTF
显示 更早的评论
Hello all,
I am using SPRINTF to format a string for a plot title, like so:
str = sprintf('The title %s', f)
I get the lint message "The function SPRINTF is apparently called with a cell array (argument 2)".
The variable f is defined as such: If the value of another variable n equals 1 then f is defined as a cell array of strings {'1Hz', '2Hz', '3hz'}. If n equals 0 then f is simply a 1x3 character array ['3Hz'].
When I use SPRINTF in the instance above, the value of n is always 0, so f in this case would never be a cell array. Yet MATLAB seems to assume that, because f is sometimes a cell array then it is a cell array (which in this case it is not).
Basically, is there a way of suppressing this message? I like my lint checker to be green and it's bugging me :-)
Thanks,
Louis Vallance
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!