Info
此问题已关闭。 请重新打开它进行编辑或回答。
Accessing the indicies of an element of matrix in cell array
1 次查看(过去 30 天)
显示 更早的评论
Hey all,
Hope this time i will get a solution to my problem at least.
A = {[22,40,46],['Node22';'Node40';'Node46'] };
s = 40
% may be conversion need here to get only row and col. P = cell2mat(A{1});
%nA = numel(A);
n = 50;
Match = cell(1, n);
for i = 1:n
[row,col] = find(P == s,1);
%match{iA} = [row,col];
end
Here How can I access the row and col, for an example I need to get row and col separately or together when the number is 40
i.e P(1,2)
I think it is possible by converting cell2mat(A{1}). I just need to get the row and col elements of first matrix in a cell array. for an example A = [1 2 3 5], we can get the idex of 5 is A(1,4). But I am not an expert to figure it out how it is?
I don't know whether it is weird question or not!
Thanks in advance
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!