Unexplicable "Operands to the logical AND .." error from "histogram" command
2 ビュー (過去 30 日間)
古いコメントを表示
I have a script written on a computer using Matlab 2023a, which runs without problems. I ran that script on another PC, with a new installation of Matlab 2023a (preference folder copied from the old PC). The script seems to stumble with the histogram command, always throwing the error
Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to reduce operands to logical scalar values.
Error in histogram (line 63)
if nargin == 3 && ishandle(varargin{end}) && varargin{end} ~= 0
Without detailing the data structures of said script, a minimal running example is the one found in the Matlab documentation example:
x = randn(1000,1)
h = histogram(x,'Normalization','probability')
which gives the same error as above.
To recap, Matlab versions, settings, file paths, and script contents, are all identical between the two PCs, yet this histogram error Is only thrown on the newer PC. Any ideas?
0 件のコメント
採用された回答
Walter Roberson
2024 年 2 月 25 日
In R2023a, the first line of histogram.m that is not a comment, is line 134; you are getting the error on line 64.
You have some third-party histogram function that is interfering.
which -all histogram
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!