nelson-lang / nelson

The Nelson Programming Language
https://nelson-lang.github.io/nelson-website/
GNU Lesser General Public License v3.0
92 stars 16 forks source link

Matrix Parsing/Evaluation Bug #1200

Closed rdbyk closed 4 months ago

rdbyk commented 4 months ago

Describe the bug

An expression "[ ... ]" to create a matrix, which contains variables throws an error and does not create the matrix as expected.

To Reproduce

a=1;b=2;c=3; A=[a a a; b b b; c c c]

Expected behavior

Matrix A should be be created without error.

Screenshots

Screenshot from 2024-05-28 07-44-59

Desktop (please complete the following information):

Additional context None.

Nelson-numerical-software commented 4 months ago

Temp workaround:

 A=[a, a, a; b, b, b; c, c, c]

Case OK:

 A=[a, a, a]
A = [a a  ;a  -a] 
[a a  ; -a  a] 
[a a; a (a)]

Case KO:

 A=[a a; a a]
rdbyk commented 4 months ago

Ok, thanks!

Nelson-numerical-software commented 4 months ago

matlab also allow: A=[-0.095-0.021j,-1]

Nelson-numerical-software commented 4 months ago

in progress ... image