필터 지우기
필터 지우기

naming of a variable

조회 수: 2 (최근 30일)
monika mangla
monika mangla 2016년 7월 26일
댓글: Stephen23 2016년 7월 26일
how can i have a variable name to be as name1 name2 name3 upto namen. i can't use array for this. i want something like for i = 1:1:n namei = "something"; end
  댓글 수: 1
Stephen23
Stephen23 2016년 7월 26일
"i can't use array for this"
Why not ?

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

답변 (1개)

Guillaume
Guillaume 2016년 7월 26일
" i can't use array for this."
Yes you can, and you should. The array can be a cell array. You could also use a map
There is absolutely zero upside and lots of downside in having sequential variable names. They're obviously related, so they should be grouped together in a container.
See the FAQ for the various options.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by