×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Port Dimensions error, embedded Matlab/constant block

Port Dimensions error, embedded Matlab/constant block

Port Dimensions error, embedded Matlab/constant block

(OP)
Hi,

I hope you can help.  I am trying to set up a test of an imbedded Matlab function I have produced.  I have it set up with a series of constant blocks that get their values from an initialisation script.

Whenever I run it, I get the following error:

??? Error using ==> sim
--> Error reported by S-function 'sf_sfun' in 'initTest/chebyInit/chebyInit/ SFunction ':
Errors occurred during parsing of Embedded MATLAB function 'chebyInit/chebyInit'(#161).
--> Error in port widths or dimensions.  Output port 1 of
'initTest/chebyInit/chebyInit/chebyTcOrderVec' is a one dimensional vector with 1 elements.


ChebyTcOrderVec is an input port which gets its values from a constant block of the same name and which I would expect to be a 1 dimensional vectore with one element as it just takes in an integer value.

The code for the set up is below, I'm not sure how helpful it will be.  All the variables in the script below are then used as constant values from constant blocks. If you need any more information please do let me know as I am stumped and would really appreciate some assistance.  Thanks, Robyn

%% Set up Case Specific Values

        chebyTcSegStart = 19;
        chebyTcSegEnd = 210;
        chebyTcOrderSca = 7;
        chebyTcOrderVec = 7;
        tSwitch = 20.1;
        orderMax = 9;

%% Profile 2

% Define the second set of conditions:
% Definition of the arbitary axis:
u2 = [3 0 1];
u2 = u2/norm(u2);
u2 = u2';

%deffinition of the angle (a)
t2 = -1:0.01:1200;
a2 = sin(t2/100);

s2 = cos(a2/2);
u2 = u2* sin(a2/2);

qhist_B = [s2; u2];
qhist_B = qhist_B';

% segStart_B = 200;
% segEnd_B = 1000;


% generate the coefficients
coeff1 =compute_chebychev_coef_v2(t2,qhist_B,1,chebyTcOrderSca+1,chebyTcSegStart,chebyTcSegEnd);
coeff2 =compute_chebychev_coef_v2(t2,qhist_B,2,chebyTcOrderVec+1,chebyTcSegStart,chebyTcSegEnd);
coeff3 =compute_chebychev_coef_v2(t2,qhist_B,3,chebyTcOrderVec+1,chebyTcSegStart,chebyTcSegEnd);
coeff4 =compute_chebychev_coef_v2(t2,qhist_B,4,chebyTcOrderVec+1,chebyTcSegStart,chebyTcSegEnd);

%Define the input values for profile 2
chebyTcCoefSca = coeff1;
chebyTcCoefVec = [coeff2, coeff3, coeff4];

%% run Init Block
sim initTest
Replies continue below

Recommended for you

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close