Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

1 次查看(过去 30 天)
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 个评论
Walter Roberson
Walter Roberson 2016-11-29
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 2016-11-29
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.

回答(1 个)

KSSV
KSSV 2016-11-29
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 个评论

此问题已关闭。

产品

Community Treasure Hunt

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

Start Hunting!

Translated by