How to load matlab code to simulink

2 ビュー (過去 30 日間)
anna
anna 2017 年 4 月 6 日
how can i load a matfile from matlab to simulink blockset? I need to use simulink blocks completely. is there any user deined blocks or inbuilt blocks to load matfile to simulink blocks?
for my project I need to segment wbc from blood smear using kmeans clustering and CIE lab conversion.I wrote the code in matlab. Now, I need to load .mat file completely to simulink.
kindly help

回答 (1 件)

Richard Zappulla
Richard Zappulla 2017 年 4 月 6 日
You can use the "From File" block in the Simulink/Sources Group. Note, this will incrementally read from the MAT file. This also assumes a single variable in a vector/matrix form.
If you have multiple variables or need to use the entire dataset at once, you can always load the MAT file to your workspace and then use "Constant" blocks (with the input parameter being the variable name you want) to bring the variables into the Simulink diagram.
  4 件のコメント
anna
anna 2017 年 4 月 13 日
the input and output is image as i need to segment wbc
Carlos Eduardo Correia Gatell
Carlos Eduardo Correia Gatell 2020 年 7 月 29 日
Hi Anna, did you ever solve this problem? I have a similar issue. I have a matcode code and I want to put it into my Simscape model, but so far no luck.
Thanks,

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by