Filter löschen
Filter löschen

Matlab find an element in matrix

1 Ansicht (letzte 30 Tage)
Nadia Bica
Nadia Bica am 8 Jul. 2015
Bearbeitet: bio lim am 8 Jul. 2015
hello, I have a matrix that has many elements and I would like to know if I have a specific element on it All my variables are symbolic at this point. I already used : [i,j] = find( x==q^2) the output: i =
[]
j =
[]
so whats this means? I Have it somewhere or not?

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 8 Jul. 2015
Bearbeitet: Azzi Abdelmalek am 8 Jul. 2015
syms q
x=[2*q q^2 5*q]
[i,j] = find(x==q^2)
The result is
i =
1
j =
2

Weitere Antworten (1)

bio lim
bio lim am 8 Jul. 2015
Bearbeitet: bio lim am 8 Jul. 2015
It means your matrix 'x' does not have an element that is equal to q^2.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by