I used to have an options with right mouse click to ignore any errors in the editor, but it no longer apears. What happened to it? This is worse than irritating as it makes it difficult to see if the file contains errors. For example, when appending a table with a cell of strings the editor gives an error saying that I should be using square braces. I now have to continuously go through every error to see if it is something that should be ignored or not.

9 commentaires

Walter Roberson
Walter Roberson le 18 Fév 2021
Are you using live script? the ignore options seem reduced for it
Matthew Parry
Matthew Parry le 18 Fév 2021
Yes, it is a live script. I was definitely able to ignore errors before though, as I used this feature quite a bit. I looked through the options, but I couldn't find one that would enable it again.
Sahithi Kanumarlapudi
Sahithi Kanumarlapudi le 22 Fév 2021
Hi,
Could you let me know which release of MATLAB are you using?
Matthew Parry
Matthew Parry le 22 Fév 2021
R2020b. Ignoring errors works for normal .m files, just not for .mlx files.
Sahithi Kanumarlapudi
Sahithi Kanumarlapudi le 25 Fév 2021
I need some clarification on your issue. Are you trying to supress warnings or errors? . Because there is a way to supress warnings in MATLAB (which is present in R2020b also for both types of scripts) but not errors.
Example:
user codes
x=[1:10]
MATLAB editor creates two warnings for this:
  1. you do not need the []
  2. put a semi-colon at the end of the line to supress output
The legacy editor permits you to dismiss a number of warnings by using right click and choosing appropriate options. It then writes %<> codes into the file that signal to the editor to not flag that warning
But Live script editor has less facility on right click to mark syntax warnings to be dismissed. It is also missing most of the Fix facilities that the legacy editor has.
This has nothing to do with
warning off
It is about the editor level warnings like "end if column does not align"
Matthew Parry
Matthew Parry le 25 Fév 2021
What Mr Roberson said is exactly what I meant.
Michael Abboud
Michael Abboud le 2 Mar 2021
Hi Matthew, sorry to hear about this issue. The live script should behave the same as a plain code (.m) file, when it comes to these fix and suppression options (as of R2020a).
When I add a bunch of semicolons to a live script in R2020b and then right-click on the warning, I see the following options: "Remove semicolon.", "Suppress Message...", and "Open Message or Expand Details".
  • What do you see in this case?
As a workaround, you could try inserting the suppression manually. For example, you could copy the relevant code to the plain code editor, then suppress using "In This File". This will create a directive like "%#ok<*NOPRT>". You can then paste this into your live script to suppress the message.
Matthew Parry
Matthew Parry le 3 Mar 2021
It now seems to be working again. It must have been the latest update that I installed the other day that changed things.

Connectez-vous pour commenter.

 Réponse acceptée

Michael Abboud
Michael Abboud le 3 Mar 2021

0 votes

The live script should behave the same as a plain code (.m) file, when it comes to these fix and suppression options (as of R2020a).
When I add a bunch of semicolons to a live script in R2020b and then right-click on the warning, I see the following options: "Remove semicolon.", "Suppress Message...", and "Open Message or Expand Details".
It sounds like the issue has resolved itself, but as a workaround you could try inserting the suppression manually. For example, you could copy the relevant code to the plain code editor, then suppress using "In This File". This will create a directive like "%#ok<*NOPRT>". You can then paste this into your live script to suppress the message.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by