Dynamic variables matlab

后端 未结 2 1522
耶瑟儿~
耶瑟儿~ 2020-12-21 10:46

How can I access to dynamic variables in Matlab? I search for similar question but I didn\'t find.

Example (simplified):

for i=1:1
    aux3=(i-1)*50;         


        
2条回答
  •  半阙折子戏
    2020-12-21 11:28

    To follow on from Oli's suggestions, see this piece of the MATLAB FAQ:

    http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F

    which shows how to use structures and cell arrays as an alternative to eval.

提交回复
热议问题