# Direct computation with Table

## Description

You can perform calculations directly on tableswithout needing to index into them.

To perform such operations using the same syntax as you would for arrays, your tables must meet several criteria:

All variables within the table must have data types that support the intended calculations (e.g., numeric or logical types).

When performing an operation where only one operand is a table, the other operand must be either a numeric or logical array.

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).

Below is an example that demonstrates how to perform calculations without explicitly indexing into the table.

## Example

Direct computation on Tables

```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), [acos](../trigonometric_functions/acos), [acosh](../trigonometric_functions/acosh), [acot](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/acot.html), [acotd](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/acotd.html), [acoth](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/acoth.html), [acsc](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/acsc.html), [acscd](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/acscd.html), [acsch](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/acsch.html), [asec](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/asec.html), [asecd](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/asecd.html), [asech](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/asech.html), [asin](../trigonometric_functions/asin), [asind](../trigonometric_functions/asind), [asinh](../trigonometric_functions/asinh), [atan](../trigonometric_functions/atan), [atand](../trigonometric_functions/atand), [atanh](../trigonometric_functions/atanh), [ceil](../elementary_functions/ceil), [cosd](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/cosd.html), [cosh](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/cosh.html), [cospi](../trigonometric_functions/cospi), [cot](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/cot.html), [cotd](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/cotd.html), [coth](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/coth.html), [csc](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/csc.html), [cscd](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/cscd.html), [csch](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/csch.html), [exp](../elementary_functions/exp), [fix](../elementary_functions/fix), [floor](../elementary_functions/floor), [log](../elementary_functions/log), [log10](../elementary_functions/log10), [log1p](../elementary_functions/log1p), [log2](../elementary_functions/log2), [nextpow2](../elementary_functions/nextpow2), [round](../elementary_functions/round), [sec](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/sec.html), [secd](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/secd.html), [sech](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/sech.html), [sin](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/sin.html), [sind](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/sind.html), [sinh](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/sinh.html), [sinpi](../trigonometric_functions/sinpi), [sqrt](../elementary_functions/sqrt), [tan](../trigonometric_functions/tan), [tand](../trigonometric_functions/tand), [tanh](../trigonometric_functions/tanh), [var](../statistics/var), [acosd](../trigonometric_functions/acosd), [not](../operators/not), [plus](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/plus.html), [minus](../elementary_functions/minus), [times](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/times.html), [eq](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/eq.html), [ge](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/ge.html), [gt](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/gt.html), [le](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/le.html), [ne](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/ne.html), [lt](https://github.com/Nelson-numerical-software/nelson-gitbook/blob/master/en/table/lt.html), [mrdivide](../operators/mrdivide), [rem](../elementary_functions/rem), [power](../operators/power), [pow2](../elementary_functions/pow2), [or](../operators/or), [mod](../elementary_functions/rem), [ldivide](../operators/ldivide).

## History

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

## Author

Allan CORNET
