# \#function

**URL:** https://forum.plexim.com/tag/function/56.md

[Latest](https://forum.plexim.com/latest.md) · [Categories](https://forum.plexim.com/categories.md) · [Tags](https://forum.plexim.com/tags.md)

---

## [Syntax for writing functions in function blocks](https://forum.plexim.com/t/syntax-for-writing-functions-in-function-blocks/1385)

<div class="topic-metadata">

**Author:** [@JuanMa\_277](https://forum.plexim.com/u/JuanMa_277)\
**Replies:** 4\
**Last updated:** [August 16, 2024, 12:17pm UTC](https://forum.plexim.com/t/syntax-for-writing-functions-in-function-blocks/1385 "2024-08-16T12:17:56Z")

</div>

I would like to ask you about how to write functions in function blocks. The manual explains that it follows the C syntax. But it is not clear how. I want to use a function block to calculate the angle between variables…

---

## [Parameterize function-block via m-File](https://forum.plexim.com/t/parameterize-function-block-via-m-file/1196)

<div class="topic-metadata">

**Author:** [@utuber27](https://forum.plexim.com/u/utuber27)\
**Replies:** 1\
**Last updated:** [January 3, 2023, 3:09pm UTC](https://forum.plexim.com/t/parameterize-function-block-via-m-file/1196 "2023-01-03T15:09:32Z")

</div>

Hi, I use a m-File to write a function in the function-block in PLECS. The input variable of the function has to be a value that is recalculated in each simulation-step in PLECS. The problem is that I need to have this …

---

## [Format of Function Block](https://forum.plexim.com/t/format-of-function-block/1159)

<div class="topic-metadata">

**Author:** [@hugoc](https://forum.plexim.com/u/hugoc)\
**Replies:** 1\
**Last updated:** [September 5, 2022, 9:39am UTC](https://forum.plexim.com/t/format-of-function-block/1159 "2022-09-05T09:39:03Z")

</div>

I am attempting to use the. function block in plecs standalone. I have 6 signals and want to have a single output. equal to -0.5\*(max(u)-min(u)). Where max(u) would be the maximum value of any of the inputs. I get errors…

---

## [How to create a complicated transfer function？eg.customize a transfer function?](https://forum.plexim.com/t/how-to-create-a-complicated-transfer-function-eg-customize-a-transfer-function/1123)

<div class="topic-metadata">

**Author:** [@fire](https://forum.plexim.com/u/fire)\
**Replies:** 2\
**Last updated:** [May 18, 2022, 9:46pm UTC](https://forum.plexim.com/t/how-to-create-a-complicated-transfer-function-eg-customize-a-transfer-function/1123 "2022-05-18T21:46:18Z")

</div>

The transfer function I want to create is like this, how? I would appreciate it if you answer me.

---

## [How to realize the complex number transfer function?](https://forum.plexim.com/t/how-to-realize-the-complex-number-transfer-function/976)

<div class="topic-metadata">

**Author:** [@shichenseu](https://forum.plexim.com/u/shichenseu)\
**Replies:** 1\
**Last updated:** [March 5, 2021, 2:48am UTC](https://forum.plexim.com/t/how-to-realize-the-complex-number-transfer-function/976 "2021-03-05T02:48:02Z")

</div>

Dear specialist: The transfer function in plecs can only realize function with real number ,so is it possilble to realize a complex number transfer function? I know delaying a signal for some period can result in the …

---

## [How to approximate Diracs delta function?](https://forum.plexim.com/t/how-to-approximate-diracs-delta-function/931)

<div class="topic-metadata">

**Author:** [@ana](https://forum.plexim.com/u/ana)\
**Replies:** 2\
**Last updated:** [December 23, 2020, 12:55pm UTC](https://forum.plexim.com/t/how-to-approximate-diracs-delta-function/931 "2020-12-23T12:55:08Z")

</div>

I need to make voltage source controlled with Dirac’s function. To make either triangle or rectangle impuls which area is equal to 1. Can you please help me?

---

## [Function blocks returning a vector](https://forum.plexim.com/t/function-blocks-returning-a-vector/926)

<div class="topic-metadata">

**Author:** [@owiecc](https://forum.plexim.com/u/owiecc)\
**Replies:** 1\
**Last updated:** [December 16, 2020, 10:01am UTC](https://forum.plexim.com/t/function-blocks-returning-a-vector/926 "2020-12-16T10:01:32Z")

</div>

Can function blocks (Control→Functions & Tables) return vectors? If I use this syntax: \[u\[2\]; u\[1\]\] I get an error: Error evaluating parameter 'Expression' in component model/Fcn: While parsing: syntax error, unexpec…

---

## [Similar Matlab Function block?](https://forum.plexim.com/t/similar-matlab-function-block/449)

<div class="topic-metadata">

**Author:** [@nikilito](https://forum.plexim.com/u/nikilito)\
**Replies:** 2\
**Last updated:** [July 25, 2018, 5:10am UTC](https://forum.plexim.com/t/similar-matlab-function-block/449 "2018-07-25T05:10:21Z")

</div>

Hi everyone. In Matlab/Simulink it’s possible to write a code in a block called Matlab Function so you can manage your inputs and creates the desired outputs. Well. First question: Is there in Plecs Standalone the simi…

---

## [Display function](https://forum.plexim.com/t/display-function/437)

<div class="topic-metadata">

**Author:** [@hemangi](https://forum.plexim.com/u/hemangi)\
**Replies:** 4\
**Last updated:** [May 18, 2018, 5:13pm UTC](https://forum.plexim.com/t/display-function/437 "2018-05-18T17:13:53Z")

</div>

Can you please tell me in PLECS software ,which value shows in Display block.Is it avg valu/mean value or summation.Please check my file which is uploded.
