NLed
NLed

Reputation: 1865

How to find what Variable is assigned to a value in Matlab?

If I have an array :

A1=100 ; 
A2=200 ; 
A3=300 ; 
A4=500 ;  
A=[A1 A2 A3 A4];

A(2) will give a value of 200.

But how can I find out that A(2)=A2 ?

Upvotes: 2

Views: 56

Answers (1)

Autonomous
Autonomous

Reputation: 9075

[row,col]=find(A==200);

Answer:
row=2 -> Corresponds to A2

Is this what you want?

Upvotes: 1

Related Questions