5

I have a very simple circuit in matlab. enter image description here

There is a voltage source of 100 V peak. Both resistance if of 100 ohm. If I see the voltage in display box, it shows 36.476 V

But in the TESTV matrix it shows 25.1761 V

Why is it different?

This is the dialog properties of TESTV testv

Santosh
  • 1,871
  • 1
  • 19
  • 36

3 Answers3

3

Take the decimation as 1

See this link Matlab help link

For example, suppose you have a simulation where the start time is 0, the Limit data points to last is 100, the Decimation is 1, and the Sample time is 0.5. The To Workspace block collects a maximum of 100 points, at time values of 0, 0.5, 1.0, 1.5, ..., seconds. Specifying a Decimation value of 1 directs the block to write data at each step.

I took the decimation as 1 and I got same values in workspace and in matrix

testv

Santosh
  • 1,871
  • 1
  • 19
  • 36
1

The Display box probably show the value from a different time step. I would try changing the configuration parameters and the step time values and the simulation time.

m_power
  • 3,156
  • 5
  • 33
  • 54
1

In your "To Workspace" block you have a Decimation of 5. This means you are not logging data every time step. You are logging data only once every 5 time steps. Like m_power has noted, you may not be comparing values from same time step.

Navan
  • 4,407
  • 1
  • 24
  • 26