divide array to multiple varible of array

1 visualización (últimos 30 días)
Hassan Abulkadder
Hassan Abulkadder el 4 de Dic. de 2019
Respondida: Raj el 4 de Dic. de 2019
i would like to divide an array to group of variables's array
i have this array:
node=[ 2 4 6];
and i want to have the following:
[a b c]=node;
i want to store every value in the (node) to differeant variable accordingly so i will have
a=2;
b=4;
c=6;
is that possible
thank you

Respuesta aceptada

Raj
Raj el 4 de Dic. de 2019
For the purpose of storing you can use a structure something like this:
MyStructure = struct('Name', {{'a' 'b' 'c'}}, 'Value', [2 4 6])

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing 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