问题描述
亲爱的,
i创建这样的矩阵:
A =
1.00,0.00,0.00,92,44,0.43,0.07 ,0.43,0.05,0.00,0.00,0.00,0.00,正常。
0.00,0.00,0.00,1.00,0.00,0.00,103,54,0.49,0.06,0.49,0.04,0.00,0.00 ,正常。
0.00,1.00,0.00,0.00,255,255,1.00,0.00,1.00,0.00,0.00,0.00,0.00,0.00,蓝图。
0.00,0.00 ,255,255,1.00,0.00,1.00,0.00,0.00,0.00,0.00,0.00,蓝图。
1.00,0.00,0.00,255,255,1.00,0.00,1.00,0.00,0.00,0.00,0.00 ,0.00,smurf。
0.00,1.00,0.00,0.00,255,254,1.00,0.01,0.00,0.00,0.00,0.00,0.00,0.00,正常。
我怎么能找到一个矩阵的行号有一个'正常'值?
谢谢
hi dear's,
i create matrix like this:
A=
1.00,0.00,0.00,92,44,0.43,0.07,0.43,0.05,0.00,0.00,0.00,0.00,normal.
0.00,0.00,0.00,1.00,0.00,0.00,103,54,0.49,0.06,0.49,0.04,0.00,0.00,normal.
0.00,1.00,0.00,0.00,255,255,1.00,0.00,1.00,0.00,0.00,0.00,0.00,0.00,smurf.
0.00,0.00,255,255,1.00,0.00,1.00,0.00,0.00,0.00,0.00,0.00,smurf.
1.00,0.00,0.00,255,255,1.00,0.00,1.00,0.00,0.00,0.00,0.00,0.00,smurf.
0.00,1.00,0.00,0.00,255,254,1.00,0.01,0.00,0.00,0.00,0.00,0.00,0.00,normal.
how i can Find the row number of a matrix has a 'normal' value؟
thanks
推荐答案
A = {1.0, 1.0, 'abc' ,3; 2.0, 3.0, 'fff', 'abc'}
A =
[1] [1] 'abc' [ 3]
[2] [3] 'fff' 'abc'
[rows, cols] = find(strcmp('abc', A))
rows =
1
2
cols =
3
4
这篇关于在Matlab中找到一个具有字符串值的矩阵的行号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!