Matlab path tool refuses to save pathdef.m - matlab

I've just installed matlab 2019a and keep getting the same error where Matlab says it cannot save the pathdef.m file because it's write protected. When i choose to save to another location, and press close it keeps coming with the same question to store the pathdef.m elsewhere...? Is this a bug in 2019a?

It was a whole other issue... I tried to add a toolbox with too many items... that caused pathdef.m to freeze... now it's all working fine!!

I had a similar issue in Ubuntu 18.04 but I managed to fix it. This is what I did:
Find prefdir location by typing prefdir into MATLAB command window. In my case:
/home/myusername/.matlab/R2019a
So I did the following in Ubuntu terminal:
sudo chown -R myusername /home/myusername/.matlab/R2019a

Related

Cannot change read/write permissions on script file /usr/local/bin code

So I recently updated my Mac to iOS Ventura. Since then I am unable to type "code ." into my terminal to open vs code in whatever directory I am in. The error I get is:
/usr/local/bin/code: line 6: python: command not found /usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory
I saw a solution here and the same one somewhere else.
However, when I try was in /usr/local/bin and typed "nano code" I was unable to edit the file. I got the error [ cannot open file for writing: read-only file system ]. I also tried dragging the file into VS code but I had a similar read/write issue. I am also unable to edit the permissions when I right click on the file and hit "get info". There is no option to edit. I also tried changing the permissions on that file using chmod to no avail. It's driving me nuts that I don't have read/write permission for files on my own computer. Does anyone have an idea of how I can have writing permissions on this file?
I do know for the /usr/local/bin/code: line 6: python: command not found you can run sudo vim /usr/local/bin/code and then add 3 to the end of python on this line function realpath() { python<3> -c "import... I guess the new mac update does not support python 2 anymore so you have to specify 3. Still looking into the line 10 error. If I figure it out I will post here again.

Can't save the file «/usr/share/netbeans/10.0/etc/netbeans.conf»?

I am trying to change the jdk access path in the netbeans.conf file to solve the java.lang file not found problem and I cannot save this file with a new name or the same name, so I cannot solve the problem. It reports to me, You don't have permission for do that, how to solve?
I use linux mint 20 Ulyana.
Make sure Netbeans or a connected process is not running. Try completely powering down your system, then start it back up again.
If that does not work, then use the vi editor to edit the file and try putting "sudo" before the command like this:
sudo vi /usr/share/netbeans/10.0/etc/netbeans.conf
It may prompt you for your password.
Learning to use vi is an excellent skill.
Always be very careful using sudo. Usually there is a reason why normal users cannot access files and sudo can. So take a back up just in case.

zsh (Default PATH?) messed up with mongodb installation

seems to be imposible after hours and hours trying to solve this problem. All my sudo terminal commands are corrupted due to a several path changes, so i ask for help to set the correct environment variables.
Recently I've a failed installation of mongodb, it was my mistake cause the installation was set for mojave and i've changed several times the path (currently in Big Sur).
The problem starts when i created a .bash_profile in my home user folder, with the mongodb installation path after i moved the files .tgz to /usr/local/mongodb.
After i realized that, i note that when i run sudo 'something' in terminal nothing happens. Instead the name of the window in terminal changes from .zsh to 'sudo' 40x60 and nothing happens. This is very bad for me. Appends all of this i've installed the brand new 11.3.1 big sur update and everything crashes sum the fact that every single file is veryfying...can't at least disable gatekeeper via sudo.
In my user home folder i've:
.bash_profile: - export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
.zprofile -
#Setting PATH for Python 3.9 #The original version is saved in .zprofile.pysave PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}"
&
.zshrc
with nothing inside, empty lines.
Someone could please provide me the correct paths and commands for each of these files.
I'm only want to have sudo commands again.

Execution of bash script differs when runned from Matlab and Terminal

I have a bash script and I want to execute it from Matlab 2014b in Ubuntu 14.04. When I launch it from terminal (that I start from os) everything is ok. I try to launch it from Matlab like this
!./script.sh
It executes but cannot open image files that have to be loaded.
More than that if I launch terminal window from Matlab
!./gnome-terminal
and use it to launch the script I got the same 'file not found' problem. Text files are accessed with no problem. Path to the images are global. To load images opencv library is used. My guess is that for some reason opencv works different from Matlab, but I don't know what to do.
I spend a lot of time to figure out the problem, but still cannot resolve it. I will appreciate any advise or help.
LD_LIBRARY_PATH of Matlab shell differs from one of teminal shell. Following command in Matlab:
setenv('LD_LIBRARY_PATH', <content of LD_LIBRARY_PATH from terminal>)
solves the problem.
Content of LD_LIBRARY_PATH from terminal is printed by
echo $LD_LIBRARY_PATH

open MATLAB figure in ubuntu

In windows, a .fig created by MATLAB can be easily opened. I am wondering if there is a way in ubuntu that allows you to open a .fig file through MATLAB. I guess i can open matlab then open there figures. But there shall be better ways.
Looks like only Matlab opens it, a Google search reveals that although *.figextension is usually associated with Xfig and related software but the Matlab's figformat seems to be a different, proprietary implementation.
Ubuntu Linux File Associations and this post on askubuntu might help on catching up with windows.
EDIT:
From within MATLAB use the menu 'FILE'->'Open', or the command line open figname.fig.
I know that this thread might be old, but there might be some people that still need this... :) So:
The idea to solve this is to assign a custom command to the file type "*.fig", which is: matlab -desktop -r "open(%f)", assuming that MATLAB is in your binaries.
If not then just make a symbolic link to it, like: sudo ln -s /{MATLAB_BIN_LOCATION} /usr/bin/
Under Ubuntu, if you cannot add a custom command like this:
Right click the .fig - file --> "Open with Other Application" --> Use a custom command --> matlab -desktop -r "open(%f)"
one can use Ubuntu Tweak for that.