My Experience with Live Script is Not Meeting Expectations. Does it Meet Yours?

1 view (last 30 days)
Paul on 7 Dec 2021
Edited: Paul on 7 Dec 2021
Following up from this question ...
I've only been using Live Script for a few months now, but I've been using it over three versions: 2019a, 2020b, and 2021b.
The best word I have to describe it is "fragile."
For smallis scripts, like 50 lines and just a few plots, it seems to work fine.
But I've been working on one large script (large for me) and I've had lots of problems.
For context, the script has 759 SLOC (inluding blank and comment lines) and another 127 SLOC of functions at the bottom of the script. The script has about 30 sections of code. The script extensively uses Symbolic Math Toolbox and generates 66 figures using fplot() and plot().
Much of the time I'm only working in one section of the script. I hit ctrl-enter to run the section. Most of the time, the execution starts immediately and the section runs no problem. Sometimes, it sits there and thinks for a while, or pauses somewhere along the way, and eventually completes, which is annoying but acceptable. But sometimes, it starts and then just gets into an endless thrash. The STOP button has no effect and I resort to killing Matlab through Windows Task Manager (hoping that I saved my work before I hit ctrl-enter).
I've been using Matlab for a loooooooooooooooong time, and I don't think I've ever had to resort to killing it through Task Manager. Maybe I've had to do it and just can't recall. But with Live Script it's a regular occurance, at least relative to not ever having had to do it all previously.
Yesterday, I decided to clear all the output and try to run the entire script usig the RUN button in the ribbon. Script started to run, output was being produced, and then it just froze. I clicked on the spinning wheel in the upper left and it took me to line 586
clear ; assume(symvar(assumptions),'clear');
After killing through Task Manager I tried again, and the same thing happened. Except this time execution claimed to be stuck on line 117, which is also
clear ; assume(symvar(assumptions),'clear');
However, lots of output had already been generated from code past line 117, so I'm not sure how to interpret that.
Thinking that the problem might be due to the clear command (I use that line of code at the start of every code section), I commented out all the lines with the clear command. Same thing happened, but this time the execution was stuck on a harmless line declaring some syms variables, like
syms t real
Just for fun, I saved the script as a .m file (with line 117 and others not commented), and it ran fine with no errors, no warnings, all 66 figures generated, in less than two minutes.
My questions are:
Does anyone else have similar problems with Live Script? If so, any idea how to fix them? I'm trying to get an idea if my experience is unique before taking this any further with Tech Support.
Is it possible I'm doing something wrong in the script?
Could it be a problem with my Matab installation or my set up?
Alternatively, can anyone out there offer a testimonial with the opposite, i.e., Live Script works great, never fails, and can be used to develop extensive and complicated documents? I'd be very interested in hearing about that as well, because I think Live Script has the potential to be incredibly useful.
p.s. As I was typing this question, I started Matab, opened the script, hit the run button. Same thing. Got partway through and now stuck.The Live editor ribbon is completely blacked out as is the bar at the bottom of the editor window.

Answers (0)




Community Treasure Hunt

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

Start Hunting!