MATLAB type in Embedded MATLAB Files

4 ビュー (過去 30 日間)
Rhonda Jordan
Rhonda Jordan 2011 年 2 月 11 日
I'm incorporating an Embedded MATLAB Function in my simulink model. When compiling, I obtain the following error:
Function output 'rel' cannot be of MATLAB type.
When I click on the blue text to find the error within the embedded matlab editor, the entire file is highlighted.
What does this error mean? Within my function, I'm attempting to use csvread (I've declared it as an extrinsic function) to grab the value of a single number. For example, I have:
ava = csvread('outdata.csv',1,1,'B2..B2');
rel = 5 * ava;
Then the output of my embedded matlab function is 'rel'.
Any thoughts on this would be helpful. Thank you!

回答 (1 件)

Guy Rouleau
Guy Rouleau 2011 年 2 月 11 日
You need to declare the variable returned by CVSREAD before. For example, add:
ava = zeros(M,N);
before cvsread, with M and N the size of the matrix you expect.
  1 件のコメント
Rhonda Jordan
Rhonda Jordan 2011 年 2 月 15 日
Thanks so much!

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by