Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Sean
Sean am 28 Nov. 2016
Geschlossen: MATLAB Answer Bot am 20 Aug. 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 Kommentare
Walter Roberson
Walter Roberson am 29 Nov. 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 am 29 Nov. 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.

Antworten (1)

KSSV
KSSV am 29 Nov. 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 Kommentare
KSSV
KSSV am 29 Nov. 2016
Ohh..was the context of question is in simulink?

Diese Frage ist geschlossen.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by