how to find out the index with its value from cell arrays?

I have two cell arrays. In one cell, there is a value of the matrices with dimension 100 by 10 and other cell there is row and column number of the matrices100 by 2. the array length is same i.e. 10 for both. Now, I want to find out the the cell array with having the values from matrix (100 by 10), whose index is matched with other matrix (100 by 2).
But this error is coming 'Unable to use a value of type 'cell' as an index'. Please help me solve it.
T3=num2cell(tr1,1); % having values
V1=num2cell(v,1) % having rows and columns for 10 arrays
T3=T3';
for k1=1:10;
sigval{k1}=T3(V1(k1,1),:);
end

6 Comments

Why did you use num2cell? Which line showing error?
sigval{k1}=T3(V1(k1,1),:);
Unable to use a value of type 'cell' as an index'.
T3=num2cell(tr1,1); % having values
V1=num2cell(v,1) % having rows and columns for 10 arrays
T3=T3';
sigval = cell(10,1) ;
for k1=1:10;
sigval{k1}=T3(V1(k1,1),:);
end
I have one matrix A = 100 by 10 which shows each signal for 10 columns
Another I have a cell array, B with row and column number of 10 signals.
Now I want to find out the values from A matrix whose row and column number from array of each signal is matched with A.
Error is coming in your command "Unable to use a value of type 'cell' as an index"
If I write it for every column for matrix A it matrix but when I write it for all column it is not working
for k1=1:10;
sigval1=tr1(V1{1,1}(1:1801,1),1); % for 1st column, it working
%sigval1(:,k1)=tr1(V1{k1,1}(1:1801,1),k1); % for all columns but this command is not working
end
You can read about ismember.

Sign in to comment.

Answers (0)

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Asked:

AS
on 15 Sep 2020

Commented:

on 15 Sep 2020

Community Treasure Hunt

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

Start Hunting!