How can I create a variable name from parts of another variable name

조회 수: 4 (최근 30일)
Let's say I have 2 vectors called time34578 and disp34578. Now I want to create a new vector vel34578 using displacement and time to compute. But I'm doing this in a script so I want to build the array name vel34578 not physically type it. How?
  댓글 수: 3
jgg
jgg 2016년 1월 12일
I agree with Geoff. It seems like there should be something generating these vectors that would make this easier.
Andy Stevenson
Andy Stevenson 2016년 1월 12일
Good point Geoff. I'll take that approach rather that what I was thinking.

댓글을 달려면 로그인하십시오.

채택된 답변

Stephen23
Stephen23 2016년 1월 12일
편집: Stephen23 2019년 6월 19일

추가 답변 (1개)

Image Analyst
Image Analyst 2016년 1월 12일
The FAQ shows how to do it and explains why you should not do it: http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by