Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

is it possible to detect the end of file (and stop output) using a 'from-file' block?

1 visualización (últimos 30 días)
Sean
Sean el 28 de Nov. de 2016
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
My model requires a calibration run before processing real data. It would be very convenient to be able to read in a calibration file which could be terminated at the end, and then switch to the real input data. This cannot be done in separate steps, the calibration must be done immediately preceding the data. These are both matrix formatted time stamped data files. I am using Matlab R2015a.
  5 comentarios
Walter Roberson
Walter Roberson el 29 de Nov. de 2016
Imagine that you had a "Next Input Sample" subsystem, and that subsystem had two or more "From-File" blocks (or equivalent), and that the subsystem was built to automatically get the next available sample from the "current" file and automatically switch to the next file when it hit the end of the first. The remainder of the model does not know which file is the "active" file.
Now, would such a hypothetical sub-system work for your purposes?
The alternative is that once the end of the first file is reached, that a control signal needs to be asserted to notify the rest of the model that you are switching out of calibration phase because the rest of the model needs to do something slightly different. An example of this would be a situation in which a Neural Network had to be instructed to switch out of training mode and enter pure classification (or prediction) mode.
Sean
Sean el 29 de Nov. de 2016
Yes, that would solve the problem. In essence, a variant of a 'from-file' block that stops when the file ends and sets a signal to indicate the event. I would like to control the switching, since the order of the files to be executed will change based on the environment of the experiment. I could provide all of the basic calibrations and sequence them using a table. It would allow me to update parameters between stages that depend on previous stage outputs.

Respuestas (1)

KSSV
KSSV el 29 de Nov. de 2016
That is not a deal.....you first read the file, pick your required data from the file and then do what you want. There are many ways to read a file, it depends on how your file is. Read below for the possible functions:
  3 comentarios
KSSV
KSSV el 29 de Nov. de 2016
Ohh..was the context of question is in simulink?

La pregunta está cerrada.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by