MATLAB Answers


Plot data arrays from loaded data structure file

Asked by Shane Palmer on 14 Nov 2019 at 4:01
Latest activity Commented on by Shane Palmer on 15 Nov 2019 at 16:25
Hello, I am not understanding the difference in my loaded data arrays. I have a 1x1001 array that I can plot just fine, but I want to plot it against arrays that are in the data structure as well. These other arrays have a 1x1x1001 structure, which I don't understand what that means, but I assume that is the reason the error "Data cannot have more than 2 dimensions" pops up when I try to plot both arrays. Do you have any suggestions for this? See screen shot for error.
xlabel('Omega (rad/s)'), ylabel('Magnitude')


Sign in to comment.

1 Answer

Answer by Luuk van Oosten on 14 Nov 2019 at 9:41
 Accepted Answer

Hello Shane Palmer,
You are not the first one to encounter this problem. For approaches to solve your problem, have a look here and here, and I am sure you will be able to fix your error. Basically what you have to do is make a 1x1001 array out of your 1x1x1001 to match the data requirements for plotting using 'plot'.
Best regards.

  1 Comment

Thank you very much, I was not able to find those solutions, they solved the problem! Thank you!

Sign in to comment.