Skip to content

Commit 984a123

Browse files
v1.9.0
1 parent ad6c3e1 commit 984a123

17 files changed

+334
-13
lines changed

en/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![banner](banner_homepage.png)
22

3-
### Nelson 1.8.0.0
3+
### Nelson 1.9.0.0
44

55
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.
66

en/SUMMARY.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,21 @@
210210

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

213-
- [Accessing and Manipulating Tables in Nelson](./table/accessing_manipulating_table.md)
213+
- [Accessing and Manipulating Tables in Nelson](./table/1_accessing_manipulating_table.md)
214+
- [Direct computation with Table](./table/2_direct_compution_with_table.md)
214215
- [array2table](./table/array2table.md)
215216
- [cell2table](./table/cell2table.md)
217+
- [head](./table/head.md)
216218
- [height](./table/height.md)
217219
- [istable](./table/istable.md)
220+
- [removevars](./table/removevars.md)
221+
- [renamevars](./table/renamevars.md)
218222
- [struct2table](./table/struct2table.md)
219223
- [table](./table/table.md)
220224
- [table2array](./table/table2array.md)
221225
- [table2cell](./table/table2cell.md)
222226
- [table2struct](./table/table2struct.md)
227+
- [tail](./table/tail.md)
223228
- [width](./table/width.md)
224229

225230
- [integer](./integer/README.md)
@@ -498,7 +503,7 @@
498503
- [acscd](./trigonometric_functions/acscd.md)
499504
- [acsch](./trigonometric_functions/acsch.md)
500505
- [asec](./trigonometric_functions/asec.md)
501-
- [secd](./trigonometric_functions/asecd.md)
506+
- [asecd](./trigonometric_functions/asecd.md)
502507
- [asech](./trigonometric_functions/asech.md)
503508
- [asin](./trigonometric_functions/asin.md)
504509
- [asind](./trigonometric_functions/asind.md)

en/changelogs/CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 1.9.0 (2024-10-26)
9+
10+
### Added
11+
12+
- Table direct computation:
13+
14+
- unary functions: `abs`, `acos`, `acosh`, `acot`, `acotd`, `acoth`,
15+
`acsc`, `acscd`, `acsch`, `asec`, `asecd`, `asech`,
16+
`asin`, `asind`, `asinh`, `atan`, `atand`, `atanh`,
17+
`ceil`, `cosd`, `cosh`, `cospi`, `cot`, `cotd`,
18+
`coth`, `csc`, `cscd`, `csch`, `exp`, `fix`,
19+
`floor`, `log`, `log10`, `log1p`, `log2`, `nextpow2`,
20+
`round`, `sec`, `secd`, `sech`, `sin`, `sind`,
21+
`sinh`, `sinpi`, `sqrt`, `tan`, `tand`, `tanh`,
22+
`var`, `acosd`, `not`.
23+
- binary functions: `plus`, `minus`, `times`, `eq`, `ge`, `gt`, `le`,
24+
`ne`, `lt`, `rdivide`, `rem`, `power`, `pow2`, `or`, `mod`, `ldivide`.
25+
26+
- `end` magic keyword can be overloaded for classes (applied to `table` class).
27+
- [#1250](http://github.com/nelson-lang/nelson/issues/1250) `head`, `tail` functions for table and array.
28+
- [#1248](http://github.com/nelson-lang/nelson/issues/1248) `removevars`, `renamevars` functions for table.
29+
30+
### Changed
31+
32+
- [#1259](http://github.com/nelson-lang/nelson/issues/1259) Add macOS Sequoia and remove macOS Monterey CI support.
33+
- Qt 6.8 LTS support (used on Windows 64 bits binary).
34+
- Python 3.13.0 on Windows.
35+
- Boost 1.86 on Windows.
36+
837
## 1.8.0 (2024-10-04)
938

1039
### Added

en/table/accessing_manipulating_table.md en/table/1_accessing_manipulating_table.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ T_vert = [T1; T3] % or T_vert = vertcat(T1, T3)
125125

126126
## See also
127127

128-
[table](table.md).
128+
[table](table.md), [Direct computation with Table](2_direct_compution_with_table.md).
129129

130130
## History
131131

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Direct computation with Table
2+
3+
## Description
4+
5+
<p>You can perform calculations directly on tableswithout needing to index into them.</p>
6+
<p>To perform such operations using the same syntax as you would for arrays, your tables must meet several criteria:</p>
7+
<p>All variables within the table must have data types that support the intended calculations (e.g., numeric or logical types).</p>
8+
<p>When performing an operation where only one operand is a table, the other operand must be either a numeric or logical array.</p>
9+
<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>
10+
<p/>
11+
<p>Below is an example that demonstrates how to perform calculations without explicitly indexing into the table.</p>
12+
13+
## Example
14+
15+
Adding a New Column
16+
17+
```matlab
18+
% Create a sample table with sensor data
19+
T = table([1.5; -2.3; 4.7], [0.5; 1.1; -0.7], [-1; 2; 3], ...
20+
'VariableNames', {'Voltage', 'Current', 'Resistance'});
21+
22+
% Apply functions directly to the table columns
23+
abs(T)
24+
acos(T)
25+
acosh(T)
26+
T > 1
27+
T + 2
28+
T .* T
29+
abs(sin(T)) + 1
30+
```
31+
32+
## See also
33+
34+
[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).
35+
36+
## History
37+
38+
| Version | Description |
39+
| ------- | --------------- |
40+
| 1.9.0 | initial version |
41+
42+
## Author
43+
44+
Allan CORNET

en/table/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ Tables
66

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

9-
- [Accessing and Manipulating Tables in Nelson](accessing_manipulating_table.md)
9+
- [Accessing and Manipulating Tables in Nelson](1_accessing_manipulating_table.md)
10+
- [Direct computation with Table](2_direct_compution_with_table.md)
1011
- [array2table](array2table.md) - Convert homogeneous array to table.
1112
- [cell2table](cell2table.md) - Convert cell array to table.
13+
- [head](head.md) - Get top rows of table or array.
1214
- [height](height.md) - Number of table rows
1315
- [istable](istable.md) - Determine if input is table.
16+
- [removevars](removevars.md) - Delete variables from table.
17+
- [renamevars](renamevars.md) - Rename variables in table.
1418
- [struct2table](struct2table.md) - Convert a structure array into a tabular format.
1519
- [table](table.md) - A table-like array with named variables, capable of holding different data types
1620
- [table2array](table2array.md) - Convert table to homogeneous array.
1721
- [table2cell](table2cell.md) - Convert table to cell array
1822
- [table2struct](table2struct.md) - Convert table to structure array
23+
- [tail](tail.md) - Get bottom rows of table or array.
1924
- [width](width.md) - Number of table variables

en/table/SUMMARY.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
- [table](README.md)
2-
- [Accessing and Manipulating Tables in Nelson](accessing_manipulating_table.md)
2+
- [Accessing and Manipulating Tables in Nelson](1_accessing_manipulating_table.md)
3+
- [Direct computation with Table](2_direct_compution_with_table.md)
34
- [array2table](array2table.md)
45
- [cell2table](cell2table.md)
6+
- [head](head.md)
57
- [height](height.md)
68
- [istable](istable.md)
9+
- [removevars](removevars.md)
10+
- [renamevars](renamevars.md)
711
- [struct2table](struct2table.md)
812
- [table](table.md)
913
- [table2array](table2array.md)
1014
- [table2cell](table2cell.md)
1115
- [table2struct](table2struct.md)
16+
- [tail](tail.md)
1217
- [width](width.md)

en/table/head.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# head
2+
3+
Get top rows of table or array.
4+
5+
## Syntax
6+
7+
- head(A)
8+
- head(A, k)
9+
- B = head(...)
10+
11+
## Input argument
12+
13+
- A - Input array (table or other).
14+
15+
## Output argument
16+
17+
- k - a integer value: Number of rows to extract (k = 8 by default).
18+
19+
## Description
20+
21+
<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>
22+
<p><b>head(A, k)</b> displays the first k rows of A.</p>
23+
<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>
24+
25+
## Examples
26+
27+
```matlab
28+
LastName = {'Sanchez';'Johnson';'Li';'Diaz';'Brown'};
29+
Age = [38;43;38;40;49];
30+
Smoker = logical([1;0;1;0;1]);
31+
Height = [71;69;64;67;64];
32+
Weight = [176;163;131;133;119];
33+
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
34+
T = table(LastName, Age, Smoker, Height, Weight, BloodPressure)
35+
head(T, 2)
36+
```
37+
38+
```matlab
39+
A = repmat((1:50)',1, 3);
40+
head(A)
41+
```
42+
43+
## See also
44+
45+
[tail](tail.md), [table](table.md).
46+
47+
## History
48+
49+
| Version | Description |
50+
| ------- | --------------- |
51+
| 1.9.0 | initial version |
52+
53+
## Author
54+
55+
Allan CORNET

en/table/removevars.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# removevars
2+
3+
Delete variables from table.
4+
5+
## Syntax
6+
7+
- TB = removevars(TA, varsNames)
8+
9+
## Input argument
10+
11+
- TA - Input table.
12+
- varsNames - Variable names in input table to remove: character vector, string array or cell array of character vectors.
13+
14+
## Output argument
15+
16+
- TB - Table object modified.
17+
18+
## Description
19+
20+
<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>
21+
<p>You can specify the variables by name, position, or using logical indices.</p>
22+
<p>You can also remove variables from a table using <b>T(:, varsNames) = []</b>.</p>
23+
24+
## Example
25+
26+
```matlab
27+
C = {'John', 28, true; 'Alice', 35, false; 'Bob', 42, true};
28+
% Convert the cell array to a table
29+
T1 = cell2table(C)
30+
T2 = removevars(T1, 'C2')
31+
```
32+
33+
## See also
34+
35+
[table](table.md), [renamevars](renamevars.md).
36+
37+
## History
38+
39+
| Version | Description |
40+
| ------- | --------------- |
41+
| 1.9.0 | initial version |
42+
43+
## Author
44+
45+
Allan CORNET

en/table/renamevars.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# renamevars
2+
3+
Rename variables in table.
4+
5+
## Syntax
6+
7+
- TB = renamevars(TA, varsNames, newNames)
8+
9+
## Input argument
10+
11+
- TA - Input table.
12+
- varsNames - Variable names in input table: character vector, string array or cell array of character vectors.
13+
- newNames - New names for variables: character vector, string array or cell array of character vectors.
14+
15+
## Output argument
16+
17+
- TB - Table object with variable names modified.
18+
19+
## Description
20+
21+
<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>
22+
<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>
23+
<p>In this case, <b>newNames</b> must be a string array or a cell array of character vectors.</p>
24+
25+
## Example
26+
27+
```matlab
28+
C = {'John', 28, true; 'Alice', 35, false; 'Bob', 42, true};
29+
% Convert the cell array to a table
30+
T1 = cell2table(C);
31+
T2 = renamevars(T1, {'C1', 'C2'}, {'Name', 'Age'})
32+
T3 = cell2table(C);
33+
T3.Properties.VariableNames = {'Name', 'Age', 'Married'};
34+
T3
35+
```
36+
37+
## See also
38+
39+
[table](table.md), [removevars](removevars.md).
40+
41+
## History
42+
43+
| Version | Description |
44+
| ------- | --------------- |
45+
| 1.9.0 | initial version |
46+
47+
## Author
48+
49+
Allan CORNET

en/table/table.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ T('Person2', 1:2)
8080

8181
## See also
8282

83-
[Accessing and Manipulating Tables in Nelson](accessing_manipulating_table.md), [cell2table](cell2table.md), [array2table](array2table.md), [struct2table](struct2table.md).
83+
[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).
8484

8585
## History
8686

en/table/tail.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# tail
2+
3+
Get bottom rows of table or array.
4+
5+
## Syntax
6+
7+
- tail(A)
8+
- tail(A, k)
9+
- B = tail(...)
10+
11+
## Input argument
12+
13+
- A - Input array (table or other).
14+
15+
## Output argument
16+
17+
- k - a integer value: Number of rows to extract (k = 8 by default).
18+
19+
## Description
20+
21+
<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>
22+
<p><b>tail(A, k)</b> displays the last k rows of A.</p>
23+
<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>
24+
25+
## Examples
26+
27+
```matlab
28+
LastName = {'Sanchez';'Johnson';'Li';'Diaz';'Brown'};
29+
Age = [38;43;38;40;49];
30+
Smoker = logical([1;0;1;0;1]);
31+
Height = [71;69;64;67;64];
32+
Weight = [176;163;131;133;119];
33+
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
34+
T = table(LastName, Age, Smoker, Height, Weight, BloodPressure)
35+
tail(T, 2)
36+
```
37+
38+
```matlab
39+
A = repmat((1:50)',1, 3);
40+
tail(A)
41+
```
42+
43+
## See also
44+
45+
[head](head.md), [table](table.md).
46+
47+
## History
48+
49+
| Version | Description |
50+
| ------- | --------------- |
51+
| 1.9.0 | initial version |
52+
53+
## Author
54+
55+
Allan CORNET

en/trigonometric_functions/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module about sine, cosine, and related functions.
1616
- [acscd](acscd.md) - Inverse cosecant in degrees.
1717
- [acsch](acsch.md) - Inverse hyperbolic cosecant.
1818
- [asec](asec.md) - Inverse secant of angle in radians.
19-
- [secd](asecd.md) - Inverse secant of argument in degrees.
19+
- [asecd](asecd.md) - Inverse secant of argument in degrees.
2020
- [asech](asech.md) - Inverse hyperbolic secant of angle in radians.
2121
- [asin](asin.md) - Computes the inverse sine in radians for each element of x.
2222
- [asind](asind.md) - Inverse sine in degrees.

0 commit comments

Comments
 (0)