Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,232
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
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.

--




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.