Adapting older code to work with R2015a
1 view (last 30 days)
Show older comments
Hi I'm getting errors in a code I am using, which has been proven to work with R2014, but not with R2015a. Is there anyone who can help me? The errors are listed below
Error using matlab.graphics.Graphics/set
The name 'Visible' is not an accessible property for an instance of class 'matlab.graphics.GraphicsPlaceholder'.
Error in Potential_Flow_Simulator>run_Callback (line 833)
set(handles.cLalpha,'Visible','off')
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in Potential_Flow_Simulator (line 44)
gui_mainfcn(gui_State, varargin{:});
Error while evaluating Menu Callback
I can post the code as well, but I just though I'd start off with listing the errors. Any help would be very appreciated as I am not very proficient in Matlab.
I am using Matlab R2014a (academic) on a Macbook Pro running OS X El Capitan.
Thanks
0 Comments
Accepted Answer
Walter Roberson
on 25 Sep 2016
In the line
set(handles.cLalpha,'Visible','off')
handles.cLalpha is a handle to something that is defined as being a graphics object, but just a place-holder, not something that is associated with a graphics item that can be made visible.
It appears that you are using https://www.mathworks.com/matlabcentral/fileexchange/12790-panel-method-based-2-d-potential-flow-simulator
Edit the Potential_Flow_Simulator.m file. Look near line 825 for
handles.cLalpha(3)=plot([-16 16],[0 0],'Color',[0.5020 0 0],'LineWidth',1.5);
Directly above that line add
handles.cLalpha(2) = line(nan,nan); %an invisible graphics item to fill in slot #2
and that should fix the problem.
The difficulty is that the cLalpha(1) and (3) to (7) were being filled in, but cLalpha(2) was being left unassigned. When this was done it become a graphics placeholder that cannot be set to be visible or invisible. Using a line(nan,nan) creates a dot that will never be rendered (because of the nan), but will fill in the slot with something that can formally be set Visible or not.
The code needed a bunch of other updates to work with OS-X or Linux but which would not affect MS Windows. I will send the author a revised version.
More Answers (0)
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!