MATLAB Answers

Question re: pplane8.m

174 ビュー (過去 30 日間)
Panos Kevrekidis
Panos Kevrekidis 2016 年 9 月 14 日
コメント済み: Subhash Pramanik 2021 年 3 月 4 日
I am trying to run pplane8.m in an updated version of Matlab (2015b or 16a) and upon correcting various issues identified in earlier threads, I still get the following errors:
Conversion to logical from matlab.ui.control.UIControl is not possible.
Error in pplane8 (line 3124) if notice
Error in pplane8 (line 2746) pplane8('dirfield',ppdisp);
Error while evaluating UIControl Callback
Any help in resolving them would be much appreciated. The version used is attached.

回答 (3 件)

Steven Lord
Steven Lord 2016 年 9 月 14 日
This is a result of the change to the graphics system in release R2014b. Graphics handles are now objects, not doubles. This means you can no longer directly perform arithmetic with graphics handles (which I've seen people try; except in the case of incrementing figure numbers to get "the next" figure, it usually didn't work the way they expected) or use graphics handles in a logical statement.
See the "Logical Expressions with Graphics Handles" section of this page from the documentation for more information. I'm not certain what the code is trying to do with that handle, but I think you want the isempty-based approach.
  2 件のコメント
Subhash Pramanik
Subhash Pramanik 2021 年 3 月 4 日
Same question for me.


George Williams
George Williams 2017 年 2 月 17 日
  1 件のコメント
Hugh Harvey
Hugh Harvey 2017 年 2 月 17 日
Thanks George, I hope people find this code useful


Zach Gima
Zach Gima 2017 年 2 月 15 日
If anyone else is running into this issue, I have revised the most recent version of pplane8 to be mostly functional with MATLAB_R2016b. This updated version should at the very least let you 1) plot the field for your differential equation system and 2) plot solution curves. As Steven (above) and a few other threads have suggested, the majority of errors came from MATLAB_R2014a onwards changing how graphics handles are dealt with. Here are the fixes I made (may not be comprehensive):
  1. Changed instances of 'numb' to 'NumberTitle'
  2. Changed instances of 'user' to 'UserData'
  3. Changed instances of 'if notice' to 'if isgraphics(notice)'
  4. Changed instances of 'if dud.notice' to 'if isgraphics(dud.notice)'
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 2 月 15 日
Earlier I had noticed there was one figure() call that used 'number' where the rest used 'numb' ;


Community Treasure Hunt

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

Start Hunting!

Translated by