String to variable value

5 次查看(过去 30 天)
Nicolás González
Nicolás González 2019-6-17
Hello,
I am using Matlab for a college aplicattion where I have to read and operate about 200 vectors. My problem is that I do not know any way of coding able to do this authomatically, I mean, I wouldn't like to write the whole vectors one by one.
The way of operating is the next: I have about 100 electric voltage vectors with their respective values in time, and, in the same way, another 100 current vectors. What I want to do is get them divided one by one and put the results into another vector which shows electric resistance. Obiously, this division must be point by point.
Every vector is in the workspace and I made a little programm that doesn't seem to work at all. I have named them using a suffix so that I know which vector is everyone (V1, V2, V3 ... V100 and I1, I2, I3 ... I100).
In my code I use the function "strcat" to link my "V" and "I" vector with their respective number that I take from a for loop and then operate them, but the problem comes when I try to access these variables because they are only string names. How could I get the variable values from those strings?
Thank you a lot
Nicolás González
  6 个评论
Adam Danz
Adam Danz 2019-6-17
If you get stuck, you can update us where you're at here in the comment section.
Nicolás González
Nicolás González 2019-6-17
Fantastic, probably I will so thanks again for your help!
Greetings!!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by