-bash: matlab: command not found - macos

I am a bit surprised, but I can't run matlab by the terminal of my Mac.
I am trying the command
/Applications/MATLAB_R2015b.app/bin/matlab
but I get the error
-bash: matlab: command not found
Listing the contenents of the folder /Applications/MATLAB_R2015b.app/bin/ I can see the word matlab which is supposed to be the executable.
I don't know what's happening.

Try
cd /Applications/MATLAB_R2015b.app/bin/
and then
./matlab
If that, hopefully, works, then you may have a path or environment issue with your O/S which is preventing your call to /Applications/MATLAB_R2015b.app/bin/matlab from working.

add the installation directory to the PATH environment, for example:
export PATH=/Applications/MATLAB_R2017b.app/bin/:$PATH
then launch Matlab with
matlab
in your terminal

It works fine, however, if you used the default folder it would be something like export PATH=/usr/local/MATLAB/R2021b/bin/:$PATH
Additionally, remember about activating matlab before via running the activate_matlab.sh script located in the installation folder

Related

How to run zookeeper.sh file in windows

I am following this tutorial where i have to run this command in order to start the zookeeper server.
./bin/zookeeper-server-start.sh config/zookeeper.properties
But the problem is this command is not working properly. I found that .sh file is bash file that required cygwin. I have installed it and then run command like this
C:\cygwin64\bin\bash.exe ./bin/zookeeper-server-start.sh config/zookeeper.properties
But it is showing:
I can confirm that in bin directory the file is exsits. what i am doing wrong?
Here is my directory snapshot from where i running the command:
Note: I have successfully tested bin/windows zookeeper bat file but i want to run it through .sh file as the kafka security tutorial which i am following using this.
From your screenshot, I conclude that you are using Cygwin. So, please add the cygwin tag to your question.
As you can see from the error message, the command dirname is not found by bash, so assuming that your Cygwin installation is not broken, I assume that the PATH is not set correctly; in your setup, dirname.exe should be in C:/cygwin64/bin (please verify this).
Your usage of bash.exe is a bit unusual in that you run it directly from a Windows cmd prompt. The more common way would be to use it from the 'Cygwin Terminal', which you get created a Windows-link to, when installing Cygwin, or to use another suitable Terminal program; I'm using for instance mintty for this task (also available via the Cygwin installer).
Having said this, it is possible to run bash.exe in the way you are doing it, but you then have to ensure, that at least the PATH is set up correctly. One possibility to do this, is to add C:\cygwin64\bin to your Windows PATH, but this has the drawback, that some commands have the same name in the Windows world and in Cygwin, though they serve a completely different purpose, and this will bite you sooner or later. Another problem is that at some point, you will rely on other bash specific setups besides the PATH.
A better way to accomplish your goal is IMO to ensure, that the system wide bash-initialization files are sourced by bash. If I have to run the script from a Windows cmd prompt, I would run it by
C:\cygwin64\bin\bash.exe --login YOURSCRIPT
This will read the file (in your setup) C:\cygwin64\etc\profile before running YOURSCRIPT, so you can check, that the PATH is correctly set there, by looking at this file. In a default installation, this should be the case.
After having read this file, it will try to read the file .bash_profile in your Cygwin HOME directory, so if you need additional settings for your (non-interactive) bash-scripts, create this file and put your settings there.

Get the command line version of Maple

I am a mac user and I have maple installed on my computer. I can open maple like any other app. However I would like to work in terminal. I googled and
found that I can do that but I need to change some path. It was not well explained. I would really appreciate if someone can help me setting my path.
Thanks in advance.
You do not have to adjust the PATH environment variable. Doing so just makes calling the maple launch script for the Commandline Interface (aka CLI) a little easier.
Open a terminal window (xterm). Find the maple script of your Maple installation. Perhaps it will be located in some directory like /Library/Frameworks/Maple.framework/Versions/Current/bin/ say. You should be able to run that script in your terminal by running it using the full name, eg. /Library/Frameworks/Maple.framework/Versions/Current/bin/maple.
You could also alias the full name (explicit location) to some single short word.
That maple script sets everything it needs to run the Maple binaries, etc. You just have to run it (in a terminal).
Or you could make OSX launch a terminal window and call the maple script. Doesn't OSX have an automator for adding such things to the Dock? I forget the syntax but could it be something like,
open -a "/opt/X11/bin/xterm" --args "-e /Library/Frameworks/Maple.framework/Versions/Current/bin/maple"

Git bash black screen (windows)

I am trying to access git bash, but nothing happens (black screen). I used git bash many times during September and October, but when I tried today it did this. What can I do to solve this?
Thanks.
Have you had Cygwin installed? I was having this exact issue, then I found out I still had a "etc" and "bin" directories in my user folder on Windows. After removing these (As I didn't want Cygwin) GitBash worked for me again :)
Perhaps as a temporary solution you could navigate to C:\Program Files (x86)\Git\bin using the windows cmd line and execute git.exe. For me Im able to perform gitbash functions, just not with the lovely unix like syntax and interface.
Also if you include gitbash to be written to your PATH during install, the win cmd line still works.

Command not found error in Matlab, when tried to run system commands

I am trying to run image processing software called Flirt in Matlab. When I try
system'flirt'
I get a /bin/bash: flirt: command not found error.
If I try system('/usr/local/fsl/bin/flirt'); then it works fine. Typing just flirt in terminal also launches the program.
Is there a way of setting Matlab to find this program in path and running it without giving its full address?
Check system path from within MATLAB using:
getenv('PATH')
Set from within MATLAB using:
setenv('PATH', [getenv('PATH') ':/usr/local/fsl/bin']);
If that fixes it, you can add the setenv line to your MATLAB startup file.

Problem running smlnj under OSX 10.6

I downloaded and installed the SML NJ implementation using the DMG for x86 from here :
http://smlnj.cs.uchicago.edu/dist/working/110.72/index.html
However when I open a terminal window and go to /usr/local/smlnj-110.72/bin and run sml i get a bash command not found.
I am not very familiar with UNIX so I guess I am doing something wrong.
Thanks for the help!
Add the following line to your ~/.bash_profile
export PATH=$PATH:/usr/local/smlnj/bin
Then open a new terminal window and run sml.
After going to the /usr/local/smlnj-xxx/bin directory, you need to run ./sml
(as opposed to sml) because the current directory (.) is not on the default path on Unix.

Resources