Storing individual elements of vector in cell.

4 visualizaciones (últimos 30 días)
Sebastian Daneli
Sebastian Daneli el 16 de Nov. de 2021
Respondida: KSSV el 16 de Nov. de 2021
Say that i have this vector
x=[2 45 13]
and I want to store these elements in a cell, where each element is stored individually, meaning i whold get something like:
cell={[1]}, {[45]}, {[13]}
Is it possible to do this withoud writing an loops?

Respuesta aceptada

KSSV
KSSV el 16 de Nov. de 2021
x=[2 45 13]
x = 1×3
2 45 13
num2cell(x)
ans = 1×3 cell array
{[2]} {[45]} {[13]}

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by