matlab – what does Attempt to reference field of non-structure array error mean?

matlab – what does Attempt to reference field of non-structure array error mean?

Do you have any idea what does it mean?
??? Attempt to reference field of non-structure array.

Youre trying to access a field in a variable which is not a structure, which might be one of the following four:

f.s
x.s
a.s
b.s

One or more of these variables (f, x, a or b) is not a structure, but youre trying to access a field in it as if it were.

Is there any difference between syms x and sym(x)?

No.
The official documentation states that syms is a shortcut for sym.

I dont know your function signature but I got this error when I passed a string in place of an array. Started thinking typing might not be such a bad idea after all.

matlab – what does Attempt to reference field of non-structure array error mean?

Leave a Reply

Your email address will not be published.