Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to get a string with to be read as an existinf vector

1 回表示 (過去 30 日間)
Sandura Shumba
Sandura Shumba 2020 年 6 月 27 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi
I am still vey new to MATLAB so perhaps my question might be very basic, please bare with me. I have n verctors Ref1, Ref2...,Refn. These are defined and exist in my workspace. I would like to run a loop that goes through each element of each vertor. This is done one vector at a time. The easiest way i thought of to refrence each vector was to use string "Ref" and then combine it with the number each time. So if 'Ref' is a sting and n is an interger i would say "Ref"+n and this displays correctly as Ref1. The trouble is, its reaading Ref1 as a string and not as the vector that is already defined. Is there a way for me to take this string and somehow convert it so that it reads the vector and not the string
for new = 1 : n;
Ref = "Ref"+new;
  3 件のコメント
Sandura Shumba
Sandura Shumba 2020 年 6 月 27 日
Thank you
Sandura Shumba
Sandura Shumba 2020 年 6 月 27 日
編集済み: Sandura Shumba 2020 年 6 月 27 日
I created a matrix with the vectors, that works great now

回答 (0 件)

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by