Asked by Ademir Silva
on 17 May 2018

Hi, I am new user of MATLAB. I need to create a decrement function. Example:

EcAcum = Ec- (Ec- (EcAcum-Input);

At where,

EcAcum: Available kinetic energy;

Ec: Total kinetic energy;

Input: Field instantaneous energy;

My goal is to start the decrease from the EC value and decrease to zero.

I tried using Matlab Function but it did not work.

Opportunities for recent engineering grads.

Apply Today
## 8 Comments

## dpb (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401282-decrement-of-the-value-of-varivel-with-matlab-function#comment_569053

## Ademir Silva (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401282-decrement-of-the-value-of-varivel-with-matlab-function#comment_569065

## dpb (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401282-decrement-of-the-value-of-varivel-with-matlab-function#comment_569114

## Ademir Silva (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401282-decrement-of-the-value-of-varivel-with-matlab-function#comment_569137

## Greg (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401282-decrement-of-the-value-of-varivel-with-matlab-function#comment_569143

## Ademir Silva (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401282-decrement-of-the-value-of-varivel-with-matlab-function#comment_569158

## Greg (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401282-decrement-of-the-value-of-varivel-with-matlab-function#comment_569160

## Ademir Silva (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/401282-decrement-of-the-value-of-varivel-with-matlab-function#comment_569376

Sign in to comment.