Sign in
Log inSign up
David Saah

1 like

·

727 reads

5 comments

B J Rao
B J Rao
Jun 19, 2022

Sir, in matlab we create a new script every time we write a code which we can run and save for latter use. Similarly, is it possible to write code in a script file in Julia? Because numerical computations generally involve long codes which needs to be stored and written in a file which can be run at the end. Could you explain how to create a script file in Julia?

1
·
·4 replies
Robert A. Jourabchi
Robert A. Jourabchi
Jun 19, 2022

Just save your script in a .jl file and you can use whatever text editor you like(VScode, Vim, Emacs, Sublime... all have Julia syntax highlighting plugin). You can run the file both in a bash/zsh terminal or inside Julia REPL.

1
·
David Saah
David Saah
Author
·Jun 19, 2022

Thank you Robert A. Jourabchi. To add up, the script can be run using the command:

julia filename.jl

And as Robert A. Jourabchi described, you can run the script in the julia REPL with the following command:

include(/path/to/script.jl)
1
·
B J Rao
B J Rao
Jun 20, 2022

David Saah thank you

1
·
B J Rao
B J Rao
Jun 20, 2022

Thank you both. much appreciated

1
·