Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Parameterize generated RTW-S-Function VS. Parameters.Structure

Subject: Parameterize generated RTW-S-Function VS. Parameters.Structure

From: Claudio Rettenmeier

Date: 2 Jul, 2004 03:22:38

Message: 1 of 2

Hello MATLAB-Users,

I've a question regarding generation of an RTW-S-Function. My blocks
contain parameters written as structures like

MECHPARAMS.stiffness
MECHPARAMS.damping
MECHPARAMS.friction

If I generate the model into an S-Function I'm not able to set any of
these parameter tunable. It only works if I will name the parameters
that way:

MECHPARAMS_stiffness
MECHPARAMS_damping
MECHPARAMS_friction

QUESTION: AM I ABLE TO GET THE MODEL PARAMETERIZED IF I USE
STRUCTURED PARAMETERS???

Thanks!
Claudio

Subject: Parameterize generated RTW-S-Function VS. Parameters.Structure

From: riccardo

Date: 2 Jul, 2004 04:26:24

Message: 2 of 2

Claudio Rettenmeier wrote:
>
>
> Hello MATLAB-Users,
>
> I've a question regarding generation of an RTW-S-Function. My
> blocks
> contain parameters written as structures like
>
> MECHPARAMS.stiffness
> MECHPARAMS.damping
> MECHPARAMS.friction
>
> If I generate the model into an S-Function I'm not able to set any
> of
> these parameter tunable. It only works if I will name the
> parameters
> that way:
>
> MECHPARAMS_stiffness
> MECHPARAMS_damping
> MECHPARAMS_friction
>
> QUESTION: AM I ABLE TO GET THE MODEL PARAMETERIZED IF I USE
> STRUCTURED PARAMETERS???
>
> Thanks!
> Claudio

Hi Claudio,
I'm afraid the short answer is: NO.

As a quick workaround, you may write an initialization m-function
which does what you've shown in your example, i.e. scan the model for
structured parameters and replace structure elements with
corresponding unstructured Matlab workspace variables, obtained by
combining structure and field names and keeping the initial value of
original structure elements.

riccardo

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us