Rewriting pplane and dfield

조회 수: 18(최근 30일)
Roy Goodman
Roy Goodman 2020년 12월 30일
댓글: Jiro Doke 2021년 5월 22일
This is not quite a question in the usual MATLAB Answers sense, but I am hoping that someone who looks at MATLAB Answers might be able to help. I apologize in advance for the length of this submission. Other people have written to MATLAB Answers with similar questions, but none have really arrived at a satisfactory conclusions.
There is a pair of free third-party MATLAB programs for drawing direction fields and phase planes, written many years ago by John Polking and available here:
These were last updated 15 years or so ago and have not worked on any recent releases of MATLAB.
This is a real shame, as these programs are very useful for helping students to understand these important tools for analyzing ODE. Many college and university math departments use MATLAB throughout their curriculum, and these programs were a good tool for a sophomore-level math class. I used to assign them to my own classes.
There have been a number of attempts to re-create the functionality of these programs, including a Java version, an iOS replacement, a Python replacement, and a partial rewrite of the code in MATLAB. None of them work as well as pplane and dfield. So now, instead of being able to simply assign one MATLAB program, I maintain a webpage weighing the pros and cons of each replacement and telling the students to pick one:
I have found on File Exchange a number of attempts to revive this program. None of them work 100% on my Mac installation of MATLAB R2020b.
I really would like to be able to get these programs running again, but have no idea where to begin. The codes are a mess, each about 7000 lines and not even separated into functions! Plus I have no experience with GUI programming.
I think that having such a program would be very good for Mathworks, as many students first encounter MATLAB in lower-division undergraduate classes, and I often hear them complaining about the experience. Making this experience smooth might convince them that MATLAB is worth using in the future.
So, my queston: Can anybody inside or outside Mathworks help me get these programs running again at full capacity? Ideally I would like to modernize them, modularize the code, make it maintainable, and take advantage of 15 years worth of advances in MATLAB, especially the improved graphics.
  댓글 수: 12
Walter Roberson
Walter Roberson 2021년 1월 26일
Yes, it is safe to call uicontrol without assigning the result to a variable.
For R2009b and later (I think it was, maybe R2009a) you can also use [~] as the output if you are worried about side effects not happening. This can make a difference for legend() calls: legend() with zero or one outputs uses different internal representation than legend with two or more outputs.
a = uicontrol('style', 'text', 'string', 'hello')
a =
UIControl (hello) with properties: Style: 'text' String: 'hello' BackgroundColor: [0.9400 0.9400 0.9400] Callback: '' Value: 0 Position: [20 20 60 20] Units: 'pixels' Show all properties
[~] = uicontrol('style', 'text', 'string', 'stranger')

댓글을 달려면 로그인하십시오.

채택된 답변

Jiro Doke
Jiro Doke 2021년 5월 21일
You may want to try the newly "recreated" Phase Plane and Slope Field Apps.
It says it requires R2021a or later.
  댓글 수: 2
Jiro Doke
Jiro Doke 2021년 5월 22일
Excellent! Thanks for beta testing!

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by