I have a matrix eg [1,6,3], and i have a 31*1 cell array ,each element of cell is a matrix. My problem is i wants to extract matrix from the cell position {1*1},{6*1},{3*1} and to be stored all these in separate matrices.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Bharath sagar Bangaru
am 15 Mär. 2019
Kommentiert: Bharath sagar Bangaru
am 15 Mär. 2019
I use the loops and values but I can not seperate and store each iteration values as matrices please help me for this problem
Cell Assigned_P = (31 * 1)
2 Kommentare
Akzeptierte Antwort
James Tursa
am 15 Mär. 2019
Bearbeitet: James Tursa
am 15 Mär. 2019
E.g., is this what you want?
c = your 31x1 cell array
v = your vector of indexes, e.g. [1,6,3]
result = c(v); % extract the cell elements according to the indexes in v
Not sure why you want the results in separate variables. It is much simpler to access the results as simply result{1}, result{2}, and result{3}, etc.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!