Assign value to the same field of every element of non-scalar struct
问题 In Matlab, assigning cell arrays to a struct arrays field foo is possible with my_array(1000).foo = []; [my_array.foo] = some_cell{:}; Now what I would like to do is assign a single value to all fields in the array. But whatever I tried, Matlab would return error messages instead of silently assuming that if I want to assign a single element of size [1x1] , it should be assigned to all fields. I would be happy if I could simply say e.g.: my_array.foo = pi; ??? Incorrect number of right hand