when i run this script i get an error 'Field assignment to a non-structure array object.' in line 10

Answers (1)

Your ‘str’ variable is a character array or a (1x1) string object, not a structure. You cannot address it as a structure.
If you want to create a structure, see the documentation on struct (link) and related documentation for details.

Categories

Asked:

on 17 Sep 2017

Edited:

on 18 Sep 2017

Community Treasure Hunt

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

Start Hunting!