MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by pouya jamali
on 31 Oct 2012

I tried to run a Simulink block diagram which consists three *difference* blocks ... but it's not working properly ... I tried to diagnose the problem by monitoring the signal values. I found that the output value for the *difference* blocks is *not used*. I don't know what is this and what's the problem ... please help me

Answer by Sachin
on 31 Oct 2012

Check your output min & max values in block configuration.

pouya jamali
on 31 Oct 2012

I haven't specified min and max for the output... every thing is by default.

## 10 Comments

## Sachin

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108351

Please elaborate your question. For example: Configuration of the block, error received etc.

## pouya jamali

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108355

just no error received ... the block diagram run properly but the output is always zero which must be not. the configuration for the

differenceblocks is as follow: Initial condition for previous input: 0.0 Input processing: inherited## Sachin

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108359

Which matlab version & from which toolbox this block comes from?

## pouya jamali

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108361

It comes from Simulink main library from discrete branch in MATLAB R2012b.

## pouya jamali

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108363

no, the solver is variable-step discrete time...

## Sachin

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108364

What is output datatype & rounding method? And what is nature of your input data, is it a matrix of fractional values less than one?

## pouya jamali

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108366

the output data type is

Inherit: Inherit via internal ruleand also the rounding mode isfloor. the input signal is a scalar which is very small maybe in order of1e-6.## Sachin

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108368

Did you check output after first sample time is executed?

## Sachin

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108369

Probabaly you did not check your output in scope correctly, rather take it in workspace & check, you will find non zero value as initial output

## pouya jamali

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/52357#comment_108370

Ow, I think the problem is misunderstood ... I should explain it more efficient! using show port values I've monitored all the signals in my block diagram. all the signals are working properly just before passing through

differenceblock. The output of the difference block isnot usedall the time during simulation. and I think it cause the final output to be zero which must be not.