How to extract a column from a matrix by searching
1 次查看(过去 30 天)
显示 更早的评论
hi
I have an example of something I need
I want to take out a column in the matrix by searching in the first row
clc, clear
frequency = linspace(1,20,20);
amp = randi([-100,-60],10,20);
matrix_test = [frequency;amp]
[my_vec_For_example_num_11] = find(matrix_test==11) % I want to enter a number from 1 to 20 and take out its column
i_want_vec_11=matrix_test(1:end,11) %That should be the result,
The solution does not have to be with "find"
tnx :)
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!