Skip to content

Matrix syntax in shell #43

@tudny

Description

@tudny

Add support for matrices creation in shell.
TODO:

  • Write BNF rules for a matrix
  • Add those rules to parser
  • Add unit tests
  • Add documentation in GUIDE.md

Example of syntax (based on MATLAB):

% Matrix with two rows. Each row has two elements. First row [1, 4], second [3, 2]
[1 4; 3 2]
% Matrix with two rows. Each row has three elements. First row [-1/2, 5/4, 5/2], second [1/2, 13/17, -9/2]
[-1/2 5/4 5/2; 1/2 13/17 -9/2]
% Matrix with one row. This row has three elements. It contains of [a, -3/2, x]
[a -3/2 x]

This syntax does not allow arithmetic expressions apart from scalars and variables, as e.g., expression

[3/4 -2/1]

can be interpreted either as [3/4, -2/1] or [-5/4].

Metadata

Metadata

Assignees

Labels

NITDNot intended to be developed during the JNP3 project.enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions