numeric array to cell array
Mostrar comentarios más antiguos
Hi
I want to convert the following numeric array to cell array of cells having two elements each. Any help?
stress = [0 20 -160 150 -40 330 -40 170 -20 180]
what is required is:
cycles = [[0 20] [-160 150] [-40 330] [-40 170] [-20 180]]
Respuesta aceptada
Más respuestas (1)
stress = [0 20 -160 150 -40 330 -40 170 -20 180];
C = num2cell(reshape(stress, 2, []).', 2);
1 comentario
Mohammed
el 17 de Jun. de 2013
Categorías
Más información sobre Stress and Strain 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!