Zs.Zs.
Zs.Zs.

Reputation: 63

Simulink - skipping results equals to zero at writing to file

The results are shown in this picture

enter image description here

I want to skip results equals to 0 and don't write to file. File looks like at this picture for now.

enter image description here

My question is what to do if I need file with results don't equals 0, the exact time and the data, for example

Time Data
1     25
5    -50
6     52
30     5

I tried to use if case blocks with block which compare result to Zero but with no success.

Upvotes: 1

Views: 259

Answers (1)

Phil Goddard
Phil Goddard

Reputation: 10772

Use an Enabled Subsystem.

Feed the signal that you want to save into its input port and the absolute value of your signal into the Enable port. Any To File blocks in the subsystem will only write data when the subsystem is enabled, i.e. when your signal is non-zero.

Upvotes: 1

Related Questions