What is causing this error Undefined function or variable 'boolean'.

4 ビュー (過去 30 日間)
Izz Epicness
Izz Epicness 2018 年 1 月 22 日
コメント済み: Star Strider 2018 年 1 月 22 日
So basically my code was working fine for the longest time, then when I installed MATLAB r2017b on my home computer one of the functions in my script gives the following error: Undefined function or variable 'boolean'.
I am going to assume this is somethign to do with versions because it works on r2015b. Is there a fix for this?
Also the line it is referencing is: include_endpoints = boolean(include_endpoints);

回答 (1 件)

Guillaume
Guillaume 2018 年 1 月 22 日
The error message is clear. Your code use boolean (which could be a function or a variable) but it does not exists. There could be many reason for that which we can only guess at without seeing the code.
One possibility: in R2015b, you have added the folder which contains boolean.m to the path whereas you haven't done so in R2017b.
what does
which boolean -all
says in each version?
  2 件のコメント
Rik
Rik 2018 年 1 月 22 日
編集済み: Rik 2018 年 1 月 22 日
I recall vaguely that some versions also have a boolean function as a built-in, which has duplicate behavior of logical, but I can't find a reference to that in the release notes.
Star Strider
Star Strider 2018 年 1 月 22 日
Correct. It may still exist in Simulink: https://stackoverflow.com/questions/22045291/difference-between-boolean-and-logical. There was no mention of boolean when I searched the Release Notes.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by