MATLAB Answers

divide array to multiple varible of array

2 views (last 30 days)
Hassan Abulkadder
Hassan Abulkadder on 4 Dec 2019
Answered: Raj on 4 Dec 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

  0 Comments

Sign in to comment.

Accepted Answer

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

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags


Translated by