title: "Dot indexing is not supported for variables of this type" for a code that was running perfectly fine?
body: <p>I have some MATLAB code that I worked on with someone who is much more experienced in MATLAB than I am. The code was running perfectly fine the other day. When I tried running it today, I got the error &quot;Dot indexing is not supported for variables of this type&quot; and I have tried reading through many other stack overflow questions on the topic, but still struggling to resolve my issue. I will include the code up until the error below. Based on what I've read, it might be something to do with structure? I would appreciate any help or tips you could send my way. Thank you!</p>
  <pre><code>for j = 3:length(files)
  
  files(j).name
  folder_name = files(j).folder;
  file2load = strcat(folder_name, '\', files(j).name);
  
  data_input = load(file2load);
  
  trace_names = fieldnames(data_input);
  
  for i = 1:length(trace_names)
  
      data_to_plot.x = data_input.(char(trace_names(i))).data.x;
      data_to_plot.y = data_input.(char(trace_names(i))).data.y;
  </code></pre>