Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
872 views
in Technique[技术] by (71.8m points)

matlab - Input data to Simulink from workspace

Hello anyone does know? I have data(myData) from matlab workspace. And in matlab simulink I have to do control system with regulator.First how to put data(myData) to simulink model input,and I want to show in graph two value(myData and regulator).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can use the From Workspace block to read the data( lets say simin ) from the worspace.

The variable simin should a structure with following fields:

  • signals :

    • values : A column vector representing data.

    • Description : A string describing the data (can be empty)

  • time : The time stamp, Its a column vector, with dimension same as that of the signals field ( can be empty as well)

That's for importing data into Simulink. For exporting the data, you can use the To Workspace block in the Simulink library.

Notice, that the output will also be a structure unless, you specify in the properties of the To Workspace to be an array.

You can refer to the documentation here

Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...