Storing individual elements of vector in cell.

조회 수: 3 (최근 30일)
Sebastian Daneli
Sebastian Daneli 2021년 11월 16일
답변: KSSV 2021년 11월 16일
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?

채택된 답변

KSSV
KSSV 2021년 11월 16일
x=[2 45 13]
x = 1×3
2 45 13
num2cell(x)
ans = 1×3 cell array
{[2]} {[45]} {[13]}

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by