Matlab find an element in matrix

2 ビュー (過去 30 日間)
Nadia Bica
Nadia Bica 2015 年 7 月 8 日
編集済み: bio lim 2015 年 7 月 8 日
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?
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 8 日
What is x?

サインインしてコメントする。

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 8 日
編集済み: Azzi Abdelmalek 2015 年 7 月 8 日
syms q
x=[2*q q^2 5*q]
[i,j] = find(x==q^2)
The result is
i =
1
j =
2

その他の回答 (1 件)

bio lim
bio lim 2015 年 7 月 8 日
編集済み: bio lim 2015 年 7 月 8 日
It means your matrix 'x' does not have an element that is equal to q^2.

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by