I work with set of Simulink/Stateflow models. I create a time and data structure for with the simulation values to be used in form of an array. I use 'sim' to start simulation. The second argument is the structure of timespan array and fourth parameter used is the data array
e.g. in a Simulation Frames -1 to N I have a structure like
tc(1).input1.data = [1 1.5 2]
tc(1).input1.time = [0 0.025 0.050]
tc(1).input2.data = [10 20 30]
tc(1).input2.time = [0 0.025 0.050]
tc(n).input1.data = [5 5.5 6]
tc(n).input1.time = [0 0.025 0.050]
tc(n).input2.data = [2 2 3]
tc(n).input2.time = [0 0.025 0.050]
this is used for creating fourth external input to 'sim'
For ease of dynamically setting the inputs through an excel interface so that the 'tct' structure is dynamically formed I use xlsread function to read from the input excel. What happens is the floating point representations are truncated to %*.4f format. I am able to see the full representation using
but I am not able to use this precise value for simulation. I enabled format long but that does not help. The Simulation outputs are still in *.4f format only.
For calculation intesive steps I am seeing remarkable difference in the output. I want simulate the whole model in Single Precision by taking all real inputs and outputs as *.12f format. My requirements need me to have a tolerance specification as +/-0.0005 so I am observing failures in the resulting output values.