Matlab fails to launch appdesigner or open .mlapp files

I was trying to exit a debugging of a matlab app after (I thought) finishing a bug hunt. At this point, I got some strage error messages (below) and since then I can not launch appdesigner itself by entering 'appdesigner' in the command window, nor can I directly use matlab to open my app.mlapp files. When using matlab or windows directly, nothing happends, and when I try to launch appdesigner through the command window I get the below error message. After the error message, the appdesigner opens and appears to work, but no buttons activates.
It is hard to find existing help online but tried clearing the 'prefdir' but to no avail.
>> appdesigner
File: ComponentController.m Line: 1 Column: 22
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of
parentheses.
Error in appdesigner.internal.componentadapter.uicomponents.adapter.DatePickerAdapter.getDynamicProperties (line 88)
inputFormat = matlab.ui.control.internal.controller.DatePickerController.getInputFormatForView(displayFormat);

 Accepted Answer

Not really clear what is going on here, but it looks like you have a file called ComponentController.m whose error is preventing AppDesigner from opening. Please look at line 1 column 22 of this file where it reports the error and see if you can see some missing characters or other typo. If you are still stuck please attach ComponentController.m

9 Comments

Correct, it is not clear at all what is going on. I don't know what that file is and it is not part of my app. I have 1 app.mlapp file and everything that is the app is contained inside this file.
Jon
Jon on 19 Jul 2022
Edited: Jon on 19 Jul 2022
OK here is where that file is located in my installation, probably something similar for yours:
C:\Program Files\MATLAB\R2022a\toolbox\matlab\uicomponents\uicomponents\+matlab\+ui\+control\+internal\+controller\ComponentController.m
Is it possible that you somehow modifiesd something in that file by accident while you were debugging? Maybe have a look and see if you can see anything wrong with the file
It seems like you are correct! I have not intentionally edited this file but, of course, user error is probably the problem here.
I took the cheap way out and just re-installed matlab and now everything seems to work! Cheers.
Glad it is working. Might have been interesting to see what went wrong that file, but probably the re-install is a good idea to make sure everything is back to nominal.
One way that I've changed files by accident is that somehow they get open in the debugger/edit window, and then you mean to be typing in your command window but the cursor is actually in the file. Next, when you run again from the debugger (green arrow) it saves the now corrupted file. Not sure if this can happen for system files. Anyhow all's well that ends well.
Just wonder : Is there a reason why TMW won't protect the stock files with readonly mask?
Don't know if there is a reason, but some further discussion here
For Windows at least, those Mathworks files are under C:\Program Files and you're not supposed to be able to alter them, like write a bad character in there and save it. Though maybe you can if you're running at an elevated permission level, like administrator, which I doubt. Are you on Windows?
The only reason I could think of is TMW doesn't like to be blocked when there is an update.
Yes I'm on windows (11), and Jon's comment sounds like something I could do. I though all matlab files are open for edits and mistakes, but maybe I'm mistaken.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2022a

Community Treasure Hunt

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

Start Hunting!