what does the following expression do?

What data structure does the first line of code create? also what do the second and third lines of code do?
Arr=[];
Arr.N=200;
Arr.R=1

 Accepted Answer

It first creates ‘Arr’ as an empty array, the creates ‘Arr’ as a structure with fields ‘N’ and ‘R’, and assigns values to them.
See the documentation on Create Structure Array (link) and struct (link) for details.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!