String to variable value

조회 수: 5 (최근 30일)
Nicolás González
Nicolás González 2019년 6월 17일
댓글: 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