Assign variables and id
古いコメントを表示
Just a quick question so i have:
[x,y]
ans =
0.1771 0.1822
0.8296 0.0991
0.7669 0.4898
0.9345 0.1932
0.1079 0.8959
How do i assign this to have for example:
c1 = (0.1771,0.1822)
c2 = (0.8296,0.09910
c3 = (0.7669,0.4898)
...
until all values are assigned an 'id'
Thank you
2 件のコメント
Rik
2021 年 3 月 25 日
You should not do that. There are exceedingly few situations where numbered variables are a better choice than an array. A longer discussion can be found here.
An array can be indexed, while you would have to regenerate the variable every time you wanted to use it.
What is you want to achieve? We might be able to give you advice about what you could use instead.
Samuel Shlong
2021 年 3 月 25 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!