Inferred size ('[1 13]') for data ***** (#32) does not match back propagated size ('[13]') from Simulink.

138 views (last 30 days)
Hi, I am using embedded Matlab function block in Simulink. Function returns the row vector from input matrix (NxN).
function y=RowVector(x)
y =(x(1,:));
end
Following error is received: Inferred size ('[1 13]') for data *** (#32) does not match back propagated size ('[13]') from Simulink.
Can you help me in resolving this error? Regards Swapnil

Answers (4)

Shailesh Raturi
Shailesh Raturi on 2 Sep 2016
hello. step 1- click right on Matlab function and go to Explore. step 2 - there click on y, right side in general there will be size block. there is -1 written step 3- change that to [1 3] you will no get now no error njoy!!
  5 Comments

Sign in to comment.


Walter Roberson
Walter Roberson on 3 Feb 2017
y = zeros(13, 1);
y(:) = x(1,:);

Fangjun Jiang
Fangjun Jiang on 10 Oct 2011
Can you try y=x(1,:)';?

swapnil
swapnil on 10 Oct 2011
I have tried with y =x(1,:); It was just typo mistake. But it doesn't work.
  2 Comments
craq
craq on 30 Apr 2014
the transpose doesn't work for me. I tried transposing inside the Embedded Matlab Function and with a simulink block between the Embedded Matlab Function and the DeMux.

Sign in to comment.

Categories

Find more on Simulink Functions in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!