MATLAB Answers

0

Question re: pplane8.m

Asked by Panos Kevrekidis on 14 Sep 2016
Latest activity Commented on by Hugh Harvey on 17 Feb 2017
Hi,
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.

  0 Comments

Sign in to comment.

3 Answers

Answer by George Williams on 17 Feb 2017

  1 Comment

Hugh Harvey on 17 Feb 2017
Thanks George, I hope people find this code useful

Sign in to comment.


Steven Lord
Answer by Steven Lord
on 14 Sep 2016

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.

  0 Comments

Sign in to comment.


Answer by Zach Gima on 15 Feb 2017

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 Comment

Walter Roberson
on 15 Feb 2017
Earlier I had noticed there was one figure() call that used 'number' where the rest used 'numb' ;

Sign in to comment.