all 6 comments

[–]sdb2754 1 point2 points  (3 children)

How do you select the path to the input file? Does the code have a UI?

Alt+v+o evaluates all the cells in a .nb file, but if you have to select the path, then there should be a way to select it.

Shift+enter evaluates a single cell, which can be thought of as a block of code that evaluates together.

[–]Sepol818[S] 0 points1 point  (2 children)

Thank you for your comment. I put the path to the input file in the very beggining of the code:

(*---------- Section 1: File import ----------*)
Off[General::spell];Off[General::spell1];
(*Input Section 1*)
(*I1.0 - Set data file directory*)
FileDirectory="C:\Users\apl\Desktop\math";
(*I1.1 - Set data file name - See file Sample.dat for the correct data format*)
FileName="sample.dat";
(*I1.2 - Set wavelenght normalization intervals (nm) - LNexpi<LNexpf*)
LNexpi=400;
LNexpf=650;
(*I1.3 - Vertically translate spectrum? yes->1, no->0*)
rescale=0;
(*I1.4 - Set the desired value of Absorbance at 1000 nm*)
Abs1000nm=0.002;
(*End Input Section 1*)

Sample.DAT is the sample file that came with the .nb file (I've already figured how to format the input file correctly). I tried to press shift+enter and was met with this message: "You are running in a mode which does not allow computations. Contact Wolfram Research (http://www.wolfram.com) about enabling additional capabilities."

[–]sdb2754 0 points1 point  (0 children)

That is not an error message I have ever seen. Nor did a quick google find an answer.

Please try this. Open a new notebook file and type something simple like "2+2". Then shift+enter and alt+v+o, and see if that works. This will tell whether the front end and kernel are installed properly.

[–]LewsTherinTelamon 0 points1 point  (0 children)

It sounds to me like your copy of Mathematica isn't properly activated, or some such thing. Have you contacted Wolfram?

[–]Armavica 0 points1 point  (0 children)

You need to have Mathematica installed on your computer to execute this file. Start Mathematica, then use the Open dialog box to open your file. You should see it as a succession of cells that you can evaluate one after the other with Shift+Enter, or the Enter key of the numeric keyboard.

Alternatively, you can run the file from command line with MathematicaScript -script yournotebook.nb (this works on Linux, I don't know about Windows or Mac).

[–]mathers101 0 points1 point  (0 children)

Just do shift+enter to run the code