How to provide input in txt format to a Simulink Model

조회 수: 5 (최근 30일)
Tiago Portolon
Tiago Portolon 2017년 4월 7일
답변: Sara Xie 2017년 8월 3일
Hi,
Is it possible to provide input data to a Simulink Model in txt format? If so, how can I do this? I'm using Matlab/Simulink R2015b 64-bit.
Thanks, Portolon

답변 (1개)

Sara Xie
Sara Xie 2017년 8월 3일
Hi Tiago,
As I understand you are trying to load data in .txt file into Simulink model. The function textscan should be able to do this for you, it reads data from an open text file into a cell array. You can try put this function call into the model callbacks, for example 'PreLoadFcn' or 'InitFcn'. Check the documentation of model callbacks for how to use it.
To learn more about import txt file into MATLAB, check the domumentation of Ways to Import Text Files

카테고리

Help CenterFile Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by