0
$\begingroup$

I do not know how to create sturct variable in Maltab from column vectors. I have three column vectors, Voltage1 (32768x1 double), Voltage2 (32768x1 double) and Voltage3 (32768x1 double). I would like to create 1x1 struct variable with 3 fields (Voltage1-32768x1 double, Voltage2-32768x1 double and Voltage3-32768x1 double). Please help.

$\endgroup$
1
$\begingroup$
>> a1 = ones(100,1);
>> a2 = ones(100,1);
>> a3 = ones(100,1);
>> b.a1 = a1;
>> b.a2 = a2;
>> b.a3 = a3;
>> b

b =

a1: [100x1 double]
a2: [100x1 double]
a3: [100x1 double]
|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.