I try to use a Matlab script written by someone else in my reasearch group a couple of years ago. This person is not in the group anymore.
If I open the script (double click on it on Windows Explorer), Matlab starts and before even running the script or doing anything else I immediately get these 5 error messages (as pop-up windows, not as an output in the console):
Error using matlab.internal.editor.OutputPackager
Error: File: OutputPackager.p Line: 63 Column: 0
The import statement 'import.matlab.internal.editor.StdoutOutputPackager' cannot be found or cannot be imported. Imported names must end with '.*' or be fully qualified.
Unrecognized function or variable 'matlab.internal.addons.updates.getSupportPackageUpdates'.
Unrecognized function or variable 'matlab.internal.addons.updates.getSupportPackageUpdates'.
Unrecognized function or variable 'matlab.unittest.internal.ui.toolstrip.getFileInfoForToolstrip'.
Unrecognized function or variable 'matlab.unittest.internal.ui.toolstrip.getFileInfoForToolstrip'.
I use Windows 10, 64 bit and Matlab R2020a Update 5.
Unfortunately, I cannot upload the file here and I am not able to produce a reproducible example (all my other files open normally). I also tried restarting Matlab and restarting my computer.
Related
I have just downloaded Matlab toolbox and I think I did a mistake somewhere but don't know where. I have two versions of Matlab on my machine and I when I launch Matlab 19, the one I want to use, I get this two lines of error:
Unable to resolve the name slreq.utils.loadLinkSet.
Error in rmiml.getAll
When I run the first section, which is merely
clear all; close all; clc;
I get this error
Cannot find builtin function '_LiveEvaluate'
I really don't know what happened and how I could solve it. I have checked the environment variables and they seem okay.
When I run the whole script (without doing by section), I have this error occurring
Attempt to execute SCRIPT mrdivide as a function:
C:\Program Files\MATLAB\R2019b\toolbox\matlab\ops\mrdivide.m
Error in Sandbox (line 25)
X=1/2*eye(n);
I'm trying to run .exe code inside Matlab terminal (R2018a) but I'm encountering some problems.
My .exe code runs normally on Windows cmd with the following generic command (an expected output file is created)
code.exe < input
In Matlab I tried 4 approaches:
system('code.exe < input');
dos('code.exe < input');
system('code.exe < input', '-echo');
system('set path=%path:C:\Program Files\MATLAB\R2018a\bin\win64;=% & code.exe < input');
They are returning the line below and no output file is created.
ans = -1.0737e+09
Adding the "&" character at the end of the line of attempt 1, as sugested by ref and many others, Matlab opens the Windows cmd in the correct folder but does not execute the .exe code properly (no processes are running in task manager), no output file is created, e.g.:
system('code.exe < input &');
I also tried the suggestion of this reference .exe run in matlab does not create two output files like it does when run in command prompt but I was not successful. This reference suggestion is also returning and no output file is created: "ans = -1.0737e+09"
Edit:
According to this link, user Walter Roberson says "-1073741511 is hex C0000139 which appears to correspond to the Windows error code for "Entry point not found". That indicates that you either tried to execute something that was inherently not properly created (such as if you tried to directly execute the DLL that did not have a main program), or else that the program you executed tried to use a DLL that could not be found."
Any insights on how to resolve this? Thanks.
The answer from this link solved my problem.
Basically, You will have to create a batch file similar to the one below and change the Matlab path according to your version.
fid = fopen('myBatchFile.bat','w')
fprintf(fid,'%s\n','set path=%path:C:\Program Files\MATLAB\R2018a\bin\win64;=%');
fprintf(fid,'%s\n','code.exe < input')
fclose(fid)
system('myBatchFile.bat')
I compiled a script that uses the tcpip function from the instruments toolbox using MCR_R2015a. Running the generated executable on the PC I used for compiling (Windows7) is not a problem, however running it on another PC (Windows10, no Matlab installed) is. I receive the following error:
unknown variable com or unknown class com.mathworks.toolbox.instrument.TCPIP
pointing to line 123 in tcpip. The surrounding code is:
try
obj.jobject = handle(com.mathworks.toolbox.instrument.TCPIP(host,port));
catch aException
newExc = MException('instrument:tcpip:cannotCreate',aException.message);
throw(newExc); %%% this is line 123
end
Obviously com.mathworks.toolbox.instrument.TCPIP is not known. I tried to find the file defining this object to append it when compiling without success.
Where to find that file or how to compile a running executable?
As I was able to run the script inside Matlab but not the executable using the Matlab compiler runtime, I figured an unset path in the MCR may cause the error.
Not being able to find the file were the path to the TCPIP class is defined, I ended up deinstalling the MCR. Et voilá, it worked!
I am aware this solution is not answering the question how to compile scripts containing the tcpip function and running the generated exe on PCs that have no Matlab installed. But it is good enough for me.
I have always been able to use the MATLAB function block on simulink without problems, but ever since yesterday it has been giving me the message
Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.
Use 'mex -setup' to select a supported C-compiler.
After some search I tried installing Windows SDK, and reinstalling Microsoft Visual C++ 2010 Express, but the error persists.
When I run the simulink model the following message appears on MATLAB's main window, before the first message appears on simulink
Warning: ''MySQL' is not recognized as an internal or external
command,
operable program or batch file.
'MySQL' is not recognized as an internal or external command,
operable program or batch file.
VSINSTALLDIR'
exceeds MATLAB's maximum name length of 63 characters and has
been truncated to
''MySQL' is not recognized as an internal or external command,
o'.
I don't know if it they are connected, but the only recent change I made in this computer was installing MySQL in it.
Assuming you're using windows (which it looks like from the question), type !where mysql on the Matlab command prompt. If the result is blank, you've got a path issue. Let's fix it.
First off, locate where your mysql executable lives -- either type where mysql.exe in a command shell, or just find it on the filesytem. Let's assume it's in C:\Path\To\Mysql\. Then, on the Matlab command prompt, change the PATH system variable by running:
setenv('PATH', [getenv('PATH') ';C:\Path\To\Mysql\']);
Hopefully, that will work.
I am trying to run the rmagic functions extension example, but ipython crashes with console error message '\u used without hex digits in character string starting "c:\u". I suspect that this is an R error message caused by rmagic passing c:\path instead of c:\ or c:/.
There is probably an easy way to fix this (IPython or Notebook startup parameters?) , but, as a newbie to rmagic and rpy2, I need some expert help please.
The following simple snippet from the example causes the kernel to die:
import rpy2
%load_ext rmagic
%R x=1
I am a windows user...
Found a solution to this ipython/windows problem here
I am a Windows user. I went to my IPython extention folder which for me is: C:\Python27\Lib\site-packages\IPython\extensions
and opened rmagic.py for editing. Found the line
self.r('png("%s/Rplots%%03d.png",%s)' % (tmpd, png_args))
and replaced it with the line:
self.r('png("%s/Rplots%%03d.png",%s, type="cairo")' % (tmpd.replace('\\', '/'), png_args))
The reason you do this is described here
and here