Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: ndefined function or variable 'y'. The first assignment to a local variable determines its class. Function 'Embedded MATLAB Function' (#52.384.385), line 19, column 2: "y"
Replies: 1   Last Post: Jul 16, 2014 8:25 AM

 Messages: [ Previous | Next ]
 dpb Posts: 9,850 Registered: 6/7/07
Re: ndefined function or variable 'y'. The first assignment to a
local variable determines its class. Function 'Embedded MATLAB Function'
(#52.384.385), line 19, column 2: "y"

Posted: Jul 16, 2014 8:25 AM

On 07/16/2014 5:50 AM, AGUEMON wrote:
...
...

> ...i got this error while the simulation is
> running:
>
> Undefined function or variable 'y'. The first assignment to a local
> variable determines its class.
> Function 'Embedded MATLAB Function' (#52.384.385), line 19, column 2:
> "y"
>

...

> C_e(:,n1+1:n1+m1)=eye(m1,m1);
> y(1:m1,:)=C_e;
>
> for kk=1:u-1;
> y((m1*kk)+1:m1*(kk+1),:)=y(m1*(kk-1)+1:m1*kk,:)*A_e;

...

Never used the embedded toolboxen so this is purely a hypothesis -- I'd
guess it, being intended for embedded, targets has far more restrictive
rules for automagic allocation.

The first assignment is m1Xm1 but the for loop appears to extend that.
I'd guess you need to preallocate the final full size.

Contact TMW Tech Support at <mathworks.com> for full detail if this
doesn't help or lead you to being able to find the doc to support the
supposition.

--

Date Subject Author
7/16/14 AGUEMON
7/16/14 dpb