Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

matlab function block error

Status
Not open for further replies.

rameshrai

Member
Hi,

Does anybody know how to solve the error below that matlab throws when working with matlab function block in simulink?

Output '..' () has variable size but the upper bound is not specified; explicit upper bound must be provided.

thanks
 
I'm not sure, but it sounds like you have arrays and the size of the array needs to be specified. I remember I had this type of problem when working with Matlab code blocks in Simulink. I had input signals that were vectors of size that could change based on a parameter. In other words, if N=4, then the vector would be of length 4. But, I was forced to code a maximum size for those vectors within the code block itself. For example, I would initialize the vector size as 500 by setting all values to zero, and then only calculating the values of the first 4. Then on the output side, within Simulink, I used a demux block that picked out only the first 4 elements of the vector. The demux block let me have variable size for the output vector.

Perhaps you have a similar issue.
 
Yes, I looked around and found that I had to make the port variable and enter maximum value for it.

thanks steve
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top