How to transpose cell arrays within a larger cell array
Mostrar comentarios más antiguos
Hi, I was wondering how to use cellfunc to find and transpose cell arrays that are row orientated within another cell array. I can do it using a loop but I was curious how to use cell function.
Code is below, I think there is a flaw in the method because I am using a loop mentality using seperate variables.
The dynamics file is a {1x3} cell and embedded within this are another set of {3x1} cells with uniform matrices. The third cell is the one that is row and ebThe 3rd cell is the one I can change, but I still think that on a larger scale my method will cause probelms.
If someone could have a quick it would be appreciated.
Thanks
load('dynamics.mat')
%find rows in cell array
idx = find(cellfun(@isrow, dyn));
trans_dyn = (cellfun(@transpose, dyn(idx), 'UniformOutput', false));
dyn(idx) = trans_dyn;
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Number Theory en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!