MATLAB Answers


How to call structure value in simulink?

Asked by Arun Badigannavar on 25 Feb 2013
Accepted Answer by TAB

> Test_Structure

Test_Structure =

    a: [10 20 30]
    b: [50 60 70]

>> how to call above structure into simulink?




1 Answer

Answer by TAB
on 25 Feb 2013
 Accepted answer

Simply put Test_Structure.a or Test_Structure.b in constant block to use their values.


Thanks for the answer,,but rather i am looking for something else,,,like I want a *_Test_Sructure.a(1,1),_Test_Sructure.a(1,2)*values to be assigned to only one constant vlock in a for loop,,,

on 25 Feb 2013

If you want to access the elements of array, put Test_Structure.a in constant block and pass this to data port of Index vector block.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!