Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 78 characters in body
Source Link

I'm trying to multiply a matrix and a vector (imported from a csv) in Wolframscript to speed up a process normally done with Mathematica notebooks. This is my first time using Wolframscript, however, and it seems that it won't simplify my answers. For example, I have tried the simplest of examples:

file1.csv

Sqrt[2]

file2.csv

Sqrt[3]

script.wls

value1 = Import[file1.csv, "Table"];
value2 = Import[file2.csv, "Table"];

value1 = value1[[1]][[1]]value1[[1]][[1]];
value2 = value2[[1]][[1]]value2[[1]][[1]];

Print[FullSimplify[Evaluate[value1 * value2]]] //should be Sqrt[2]*Sqrt[3] = Sqrt[6]

This gives Sqrt[6] in the regular notebook, but Sqrt[2]*Sqrt[3] as output in the command line using Wolframscript.

I've tried FullSimplify, Simplify, Evaluate, etc, yet nothing seems to simplify the answer in wolframscript.

The matrices and vectors I'm trying to multiply eventually are much more complicated, so I'm trying to find a solution for this simple case. I'm wondering if it is something to do with the Sqrt function?

Thanks in advance!

I'm trying to multiply a matrix and a vector (imported from a csv) in Wolframscript to speed up a process normally done with Mathematica notebooks. This is my first time using Wolframscript, however, and it seems that it won't simplify my answers. For example, I have tried the simplest of examples:

value1 = Import[file1.csv, "Table"];
value2 = Import[file2.csv, "Table"];

value1 = value1[[1]][[1]]
value2 = value2[[1]][[1]]

Print[FullSimplify[Evaluate[value1 * value2]]]

This gives Sqrt[6] in the regular notebook, but Sqrt[2]*Sqrt[3] as output in the command line using Wolframscript.

I've tried FullSimplify, Simplify, Evaluate, etc, yet nothing seems to simplify the answer in wolframscript.

The matrices and vectors I'm trying to multiply eventually are much more complicated, so I'm trying to find a solution for this simple case. I'm wondering if it is something to do with the Sqrt function?

Thanks in advance!

I'm trying to multiply a matrix and a vector (imported from a csv) in Wolframscript to speed up a process normally done with Mathematica notebooks. This is my first time using Wolframscript, however, and it seems that it won't simplify my answers. For example, I have tried the simplest of examples:

file1.csv

Sqrt[2]

file2.csv

Sqrt[3]

script.wls

value1 = Import[file1.csv, "Table"];
value2 = Import[file2.csv, "Table"];

value1 = value1[[1]][[1]];
value2 = value2[[1]][[1]];

Print[FullSimplify[Evaluate[value1 * value2]]] //should be Sqrt[2]*Sqrt[3] = Sqrt[6]

This gives Sqrt[6] in the regular notebook, but Sqrt[2]*Sqrt[3] as output in the command line using Wolframscript.

I've tried FullSimplify, Simplify, Evaluate, etc, yet nothing seems to simplify the answer in wolframscript.

The matrices and vectors I'm trying to multiply eventually are much more complicated, so I'm trying to find a solution for this simple case. I'm wondering if it is something to do with the Sqrt function?

Thanks in advance!

Fixed problem to include importing the values from a .csv file
Source Link

I'm trying to multiply a matrix and a vector (imported from a csv) in Wolframscript to speed up a process normally done with Mathematica notebooks. This is my first time using Wolframscript, however, and it seems that it won't simplify my answers. For example, I have tried the simplest of examples:

Print[Sqrt[2]*Sqrt[3]]value1 = Import[file1.csv, "Table"];
value2 = Import[file2.csv, "Table"];

value1 = value1[[1]][[1]]
value2 = value2[[1]][[1]]

Print[FullSimplify[Evaluate[value1 * value2]]]

This gives Sqrt[6] in the regular notebook, but Sqrt[2]*Sqrt[3] as output in the command line using Wolframscript.

I've tried FullSimplify, Simplify, Evaluate, etc, yet nothing seems to simplify the answer in wolframscript.

The matrices and vectors I'm trying to multiply eventually are much more complicated, so I'm trying to find a solution for this simple case. I'm wondering if it is something to do with the Sqrt function?

Thanks in advance!

I'm trying to multiply a matrix and a vector in Wolframscript to speed up a process normally done with Mathematica notebooks. This is my first time using Wolframscript, however, and it seems that it won't simplify my answers. For example, I have tried the simplest of examples:

Print[Sqrt[2]*Sqrt[3]]

This gives Sqrt[6] in the regular notebook, but Sqrt[2]*Sqrt[3] as output in the command line using Wolframscript.

I've tried FullSimplify, Simplify, Evaluate, etc, yet nothing seems to simplify the answer in wolframscript.

The matrices and vectors I'm trying to multiply eventually are much more complicated, so I'm trying to find a solution for this simple case. I'm wondering if it is something to do with the Sqrt function?

Thanks in advance!

I'm trying to multiply a matrix and a vector (imported from a csv) in Wolframscript to speed up a process normally done with Mathematica notebooks. This is my first time using Wolframscript, however, and it seems that it won't simplify my answers. For example, I have tried the simplest of examples:

value1 = Import[file1.csv, "Table"];
value2 = Import[file2.csv, "Table"];

value1 = value1[[1]][[1]]
value2 = value2[[1]][[1]]

Print[FullSimplify[Evaluate[value1 * value2]]]

This gives Sqrt[6] in the regular notebook, but Sqrt[2]*Sqrt[3] as output in the command line using Wolframscript.

I've tried FullSimplify, Simplify, Evaluate, etc, yet nothing seems to simplify the answer in wolframscript.

The matrices and vectors I'm trying to multiply eventually are much more complicated, so I'm trying to find a solution for this simple case. I'm wondering if it is something to do with the Sqrt function?

Thanks in advance!

Source Link

WolframScript not simplifying output

I'm trying to multiply a matrix and a vector in Wolframscript to speed up a process normally done with Mathematica notebooks. This is my first time using Wolframscript, however, and it seems that it won't simplify my answers. For example, I have tried the simplest of examples:

Print[Sqrt[2]*Sqrt[3]]

This gives Sqrt[6] in the regular notebook, but Sqrt[2]*Sqrt[3] as output in the command line using Wolframscript.

I've tried FullSimplify, Simplify, Evaluate, etc, yet nothing seems to simplify the answer in wolframscript.

The matrices and vectors I'm trying to multiply eventually are much more complicated, so I'm trying to find a solution for this simple case. I'm wondering if it is something to do with the Sqrt function?

Thanks in advance!