The "Elastic" script works perfectly on OS X, but crashes on Windows 7,8,10. Why?

The "Elastic" script works perfectly on OS X, but crashes on Windows 7,8,10. Why?

4 Comments

When you say "crashes", do you mean MATLAB throws an error (and if so what is the FULL text of that error message) or MATLAB actually crashes (either disappears or brings up the "MATLAB needs to shut down" type dialog?) In the latter case, I recommend you send your crash log file to Technical Support for investigation.
The wave propagation movie works good on OS X, but doesn't work on Windows. The Matlab is okey.
Do you mean that a movie is produced, but the Windows movie players will not play it?
"movie" command on OSX and WINDOWS : the same "Elastic" script. on OSX it is ok, the wave propagates good. on WIN10 doesn't work, the wave doesn't behave as on OSX.
You should try the script to see.

Sign in to comment.

 Accepted Answer

I tried it on OS-X.
You need to set the surf() to use 'EdgeColor', 'none' or else you will get plots that are all black.
You can improve performance by doing the surf() only once and then in the iterations afterwards, set() the ZData property of the surface.
You can improve performance by pre-allocating the m structure array, and using n as the index instead of l.
I have attached Elastic.m with the performance changes.
However
Your values grow without bounds, mostly 0 except for a positive and negative spike. Eventually the difference between the maximum and minimum values exceeds 10^38, the single precision maximum range. At least in R2014a (might have changed as of R2014b), that exceeds the limits of what can be plotted in a single graph and the plot stops rendering.
Even without the change, the movie being created is really boring, consisting of a mostly flat surface with a narrow spike up and down, with the level of the flat surface moving up and down as the z coordinates automatically adjust to center whatever the spike range happens to be on any one iteration. You cannot really tell there is anything going on unless you pay close attention to the exponent in scientific notation given for the z axis, which keeps increasing until it reaches 10^38 and then the graphics vanish.
Please go back and recheck that you are using the same MATLAB releases between the machines. If you had R2014b or later on OS-X you just might happen to get graphics all the way through (no promises, I cannot test with that release) whereas if you happened to have earlier releases on the Windows machines you might get a different result.
You might also get a different result on the Windows machines if you commanded
opengl software
On my R2014a OS-X, opengl software is the only possibility, but it is switchable on MS Windows.
I think you need to go back and check if you intend that the values of the spikes grow past +/- 10^38. It seems an odd thing to graph.

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!