Skip to content

Commit

Permalink
v1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson-numerical-software committed Oct 25, 2024
1 parent ad6c3e1 commit 984a123
Show file tree
Hide file tree
Showing 17 changed files with 334 additions and 13 deletions.
2 changes: 1 addition & 1 deletion en/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![banner](banner_homepage.png)

### Nelson 1.8.0.0
### Nelson 1.9.0.0

Nelson is a powerful, open-source numerical computational language, developed to provide a comprehensive and intuitive environment for engineers, scientists, and students. With over 1,200 built-in functions, Nelson supports a wide range of tasks, from basic algebra to advanced numerical simulations.

Expand Down
9 changes: 7 additions & 2 deletions en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,21 @@

- [table](./table/README.md)

- [Accessing and Manipulating Tables in Nelson](./table/accessing_manipulating_table.md)
- [Accessing and Manipulating Tables in Nelson](./table/1_accessing_manipulating_table.md)
- [Direct computation with Table](./table/2_direct_compution_with_table.md)
- [array2table](./table/array2table.md)
- [cell2table](./table/cell2table.md)
- [head](./table/head.md)
- [height](./table/height.md)
- [istable](./table/istable.md)
- [removevars](./table/removevars.md)
- [renamevars](./table/renamevars.md)
- [struct2table](./table/struct2table.md)
- [table](./table/table.md)
- [table2array](./table/table2array.md)
- [table2cell](./table/table2cell.md)
- [table2struct](./table/table2struct.md)
- [tail](./table/tail.md)
- [width](./table/width.md)

- [integer](./integer/README.md)
Expand Down Expand Up @@ -498,7 +503,7 @@
- [acscd](./trigonometric_functions/acscd.md)
- [acsch](./trigonometric_functions/acsch.md)
- [asec](./trigonometric_functions/asec.md)
- [secd](./trigonometric_functions/asecd.md)
- [asecd](./trigonometric_functions/asecd.md)
- [asech](./trigonometric_functions/asech.md)
- [asin](./trigonometric_functions/asin.md)
- [asind](./trigonometric_functions/asind.md)
Expand Down
29 changes: 29 additions & 0 deletions en/changelogs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.9.0 (2024-10-26)

### Added

- Table direct computation:

- unary functions: `abs`, `acos`, `acosh`, `acot`, `acotd`, `acoth`,
`acsc`, `acscd`, `acsch`, `asec`, `asecd`, `asech`,
`asin`, `asind`, `asinh`, `atan`, `atand`, `atanh`,
`ceil`, `cosd`, `cosh`, `cospi`, `cot`, `cotd`,
`coth`, `csc`, `cscd`, `csch`, `exp`, `fix`,
`floor`, `log`, `log10`, `log1p`, `log2`, `nextpow2`,
`round`, `sec`, `secd`, `sech`, `sin`, `sind`,
`sinh`, `sinpi`, `sqrt`, `tan`, `tand`, `tanh`,
`var`, `acosd`, `not`.
- binary functions: `plus`, `minus`, `times`, `eq`, `ge`, `gt`, `le`,
`ne`, `lt`, `rdivide`, `rem`, `power`, `pow2`, `or`, `mod`, `ldivide`.

- `end` magic keyword can be overloaded for classes (applied to `table` class).
- [#1250](http://github.com/nelson-lang/nelson/issues/1250) `head`, `tail` functions for table and array.
- [#1248](http://github.com/nelson-lang/nelson/issues/1248) `removevars`, `renamevars` functions for table.

### Changed

- [#1259](http://github.com/nelson-lang/nelson/issues/1259) Add macOS Sequoia and remove macOS Monterey CI support.
- Qt 6.8 LTS support (used on Windows 64 bits binary).
- Python 3.13.0 on Windows.
- Boost 1.86 on Windows.

## 1.8.0 (2024-10-04)

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ T_vert = [T1; T3] % or T_vert = vertcat(T1, T3)

## See also

[table](table.md).
[table](table.md), [Direct computation with Table](2_direct_compution_with_table.md).

## History

Expand Down
44 changes: 44 additions & 0 deletions en/table/2_direct_compution_with_table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Direct computation with Table

## Description

<p>You can perform calculations directly on tableswithout needing to index into them.</p>
<p>To perform such operations using the same syntax as you would for arrays, your tables must meet several criteria:</p>
<p>All variables within the table must have data types that support the intended calculations (e.g., numeric or logical types).</p>
<p>When performing an operation where only one operand is a table, the other operand must be either a numeric or logical array.</p>
<p>For operations involving two tables, they must have compatible sizes (i.e., the same number of rows and columns or the operation must make sense for the structures involved).</p>
<p/>
<p>Below is an example that demonstrates how to perform calculations without explicitly indexing into the table.</p>

## Example

Adding a New Column

```matlab
% Create a sample table with sensor data
T = table([1.5; -2.3; 4.7], [0.5; 1.1; -0.7], [-1; 2; 3], ...
'VariableNames', {'Voltage', 'Current', 'Resistance'});
% Apply functions directly to the table columns
abs(T)
acos(T)
acosh(T)
T > 1
T + 2
T .* T
abs(sin(T)) + 1
```

## See also

[abs](../elementary_functions/abs.md), [acos](../trigonometric_functions/acos.md), [acosh](../trigonometric_functions/acosh.md), [acot](acot.html), [acotd](acotd.html), [acoth](acoth.html), [acsc](acsc.html), [acscd](acscd.html), [acsch](acsch.html), [asec](asec.html), [asecd](asecd.html), [asech](asech.html), [asin](../trigonometric_functions/asin.md), [asind](../trigonometric_functions/asind.md), [asinh](../trigonometric_functions/asinh.md), [atan](../trigonometric_functions/atan.md), [atand](../trigonometric_functions/atand.md), [atanh](../trigonometric_functions/atanh.md), [ceil](../elementary_functions/ceil.md), [cosd](cosd.html), [cosh](cosh.html), [cospi](../trigonometric_functions/cospi.md), [cot](cot.html), [cotd](cotd.html), [coth](coth.html), [csc](csc.html), [cscd](cscd.html), [csch](csch.html), [exp](../elementary_functions/exp.md), [fix](../elementary_functions/fix.md), [floor](../elementary_functions/floor.md), [log](../elementary_functions/log.md), [log10](../elementary_functions/log10.md), [log1p](../elementary_functions/log1p.md), [log2](../elementary_functions/log2.md), [nextpow2](../elementary_functions/nextpow2.md), [round](../elementary_functions/round.md), [sec](sec.html), [secd](secd.html), [sech](sech.html), [sin](sin.html), [sind](sind.html), [sinh](sinh.html), [sinpi](../trigonometric_functions/sinpi.md), [sqrt](../elementary_functions/sqrt.md), [tan](../trigonometric_functions/tan.md), [tand](../trigonometric_functions/tand.md), [tanh](../trigonometric_functions/tanh.md), [var](../statistics/var.md), [acosd](../trigonometric_functions/acosd.md), [not](../operators/not.md), [plus](plus.html), [minus](../elementary_functions/minus.md), [times](times.html), [eq](eq.html), [ge](ge.html), [gt](gt.html), [le](le.html), [ne](ne.html), [lt](lt.html), [mrdivide](../operators/mrdivide.md), [rem](../elementary_functions/rem.md), [power](../operators/power.md), [pow2](../elementary_functions/pow2.md), [or](../operators/or.md), [mod](../elementary_functions/rem.md), [ldivide](../operators/ldivide.md).

## History

| Version | Description |
| ------- | --------------- |
| 1.9.0 | initial version |

## Author

Allan CORNET
7 changes: 6 additions & 1 deletion en/table/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ Tables

Tables of arrays with named columns, each potentially containing different data types.

- [Accessing and Manipulating Tables in Nelson](accessing_manipulating_table.md)
- [Accessing and Manipulating Tables in Nelson](1_accessing_manipulating_table.md)
- [Direct computation with Table](2_direct_compution_with_table.md)
- [array2table](array2table.md) - Convert homogeneous array to table.
- [cell2table](cell2table.md) - Convert cell array to table.
- [head](head.md) - Get top rows of table or array.
- [height](height.md) - Number of table rows
- [istable](istable.md) - Determine if input is table.
- [removevars](removevars.md) - Delete variables from table.
- [renamevars](renamevars.md) - Rename variables in table.
- [struct2table](struct2table.md) - Convert a structure array into a tabular format.
- [table](table.md) - A table-like array with named variables, capable of holding different data types
- [table2array](table2array.md) - Convert table to homogeneous array.
- [table2cell](table2cell.md) - Convert table to cell array
- [table2struct](table2struct.md) - Convert table to structure array
- [tail](tail.md) - Get bottom rows of table or array.
- [width](width.md) - Number of table variables
7 changes: 6 additions & 1 deletion en/table/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
- [table](README.md)
- [Accessing and Manipulating Tables in Nelson](accessing_manipulating_table.md)
- [Accessing and Manipulating Tables in Nelson](1_accessing_manipulating_table.md)
- [Direct computation with Table](2_direct_compution_with_table.md)
- [array2table](array2table.md)
- [cell2table](cell2table.md)
- [head](head.md)
- [height](height.md)
- [istable](istable.md)
- [removevars](removevars.md)
- [renamevars](renamevars.md)
- [struct2table](struct2table.md)
- [table](table.md)
- [table2array](table2array.md)
- [table2cell](table2cell.md)
- [table2struct](table2struct.md)
- [tail](tail.md)
- [width](width.md)
55 changes: 55 additions & 0 deletions en/table/head.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# head

Get top rows of table or array.

## Syntax

- head(A)
- head(A, k)
- B = head(...)

## Input argument

- A - Input array (table or other).

## Output argument

- k - a integer value: Number of rows to extract (k = 8 by default).

## Description

<p><b>head(A)</b> displays the first eight rows of an array, or table <b>A</b> in the Command Window without assigning it to a variable.</p>
<p><b>head(A, k)</b> displays the first k rows of A.</p>
<p><b>B = head(...)</b> returns the specified rows of <b>A</b> for any of the previous syntaxes, with <b>B</b> having the same data type as <b>A</b>.</p>

## Examples

```matlab
LastName = {'Sanchez';'Johnson';'Li';'Diaz';'Brown'};
Age = [38;43;38;40;49];
Smoker = logical([1;0;1;0;1]);
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
T = table(LastName, Age, Smoker, Height, Weight, BloodPressure)
head(T, 2)
```

```matlab
A = repmat((1:50)',1, 3);
head(A)
```

## See also

[tail](tail.md), [table](table.md).

## History

| Version | Description |
| ------- | --------------- |
| 1.9.0 | initial version |

## Author

Allan CORNET
45 changes: 45 additions & 0 deletions en/table/removevars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# removevars

Delete variables from table.

## Syntax

- TB = removevars(TA, varsNames)

## Input argument

- TA - Input table.
- varsNames - Variable names in input table to remove: character vector, string array or cell array of character vectors.

## Output argument

- TB - Table object modified.

## Description

<p><b>TB = removevars(TA, varsNames)</b> removes the variables specified by <b>varsNames</b> from the table <b>TA</b> and stores the remaining variables in <b>T2</b>.</p>
<p>You can specify the variables by name, position, or using logical indices.</p>
<p>You can also remove variables from a table using <b>T(:, varsNames) = []</b>.</p>

## Example

```matlab
C = {'John', 28, true; 'Alice', 35, false; 'Bob', 42, true};
% Convert the cell array to a table
T1 = cell2table(C)
T2 = removevars(T1, 'C2')
```

## See also

[table](table.md), [renamevars](renamevars.md).

## History

| Version | Description |
| ------- | --------------- |
| 1.9.0 | initial version |

## Author

Allan CORNET
49 changes: 49 additions & 0 deletions en/table/renamevars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# renamevars

Rename variables in table.

## Syntax

- TB = renamevars(TA, varsNames, newNames)

## Input argument

- TA - Input table.
- varsNames - Variable names in input table: character vector, string array or cell array of character vectors.
- newNames - New names for variables: character vector, string array or cell array of character vectors.

## Output argument

- TB - Table object with variable names modified.

## Description

<p><b>TB = renamevars(TA, varsNames, newNames)</b> renames the variables in the table <b>TA</b> as specified by <b>varsNames</b> and assigns them the new names provided in <b>newNames</b>.</p>
<p>You can also rename all the variables in a table by assigning new names to its <b>VariableNames</b> property using <b>T.Properties.VariableNames = newNames</b>.</p>
<p>In this case, <b>newNames</b> must be a string array or a cell array of character vectors.</p>

## Example

```matlab
C = {'John', 28, true; 'Alice', 35, false; 'Bob', 42, true};
% Convert the cell array to a table
T1 = cell2table(C);
T2 = renamevars(T1, {'C1', 'C2'}, {'Name', 'Age'})
T3 = cell2table(C);
T3.Properties.VariableNames = {'Name', 'Age', 'Married'};
T3
```

## See also

[table](table.md), [removevars](removevars.md).

## History

| Version | Description |
| ------- | --------------- |
| 1.9.0 | initial version |

## Author

Allan CORNET
2 changes: 1 addition & 1 deletion en/table/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ T('Person2', 1:2)

## See also

[Accessing and Manipulating Tables in Nelson](accessing_manipulating_table.md), [cell2table](cell2table.md), [array2table](array2table.md), [struct2table](struct2table.md).
[Accessing and Manipulating Tables in Nelson](1_accessing_manipulating_table.md), [Direct computation with Table](2_direct_compution_with_table.md), [cell2table](cell2table.md), [array2table](array2table.md), [struct2table](struct2table.md).

## History

Expand Down
55 changes: 55 additions & 0 deletions en/table/tail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# tail

Get bottom rows of table or array.

## Syntax

- tail(A)
- tail(A, k)
- B = tail(...)

## Input argument

- A - Input array (table or other).

## Output argument

- k - a integer value: Number of rows to extract (k = 8 by default).

## Description

<p><b>tail(A)</b> displays the last eight rows of an array, or table <b>A</b> in the Command Window without assigning it to a variable.</p>
<p><b>tail(A, k)</b> displays the last k rows of A.</p>
<p><b>B = tail(...)</b> returns the specified rows of <b>A</b> for any of the previous syntaxes, with <b>B</b> having the same data type as <b>A</b>.</p>

## Examples

```matlab
LastName = {'Sanchez';'Johnson';'Li';'Diaz';'Brown'};
Age = [38;43;38;40;49];
Smoker = logical([1;0;1;0;1]);
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
T = table(LastName, Age, Smoker, Height, Weight, BloodPressure)
tail(T, 2)
```

```matlab
A = repmat((1:50)',1, 3);
tail(A)
```

## See also

[head](head.md), [table](table.md).

## History

| Version | Description |
| ------- | --------------- |
| 1.9.0 | initial version |

## Author

Allan CORNET
2 changes: 1 addition & 1 deletion en/trigonometric_functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module about sine, cosine, and related functions.
- [acscd](acscd.md) - Inverse cosecant in degrees.
- [acsch](acsch.md) - Inverse hyperbolic cosecant.
- [asec](asec.md) - Inverse secant of angle in radians.
- [secd](asecd.md) - Inverse secant of argument in degrees.
- [asecd](asecd.md) - Inverse secant of argument in degrees.
- [asech](asech.md) - Inverse hyperbolic secant of angle in radians.
- [asin](asin.md) - Computes the inverse sine in radians for each element of x.
- [asind](asind.md) - Inverse sine in degrees.
Expand Down
Loading

0 comments on commit 984a123

Please sign in to comment.