Plot data arrays from loaded data structure file

조회 수: 3 (최근 30일)
Shane Palmer
Shane Palmer 2019년 11월 14일
댓글: Shane Palmer 2019년 11월 15일
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.
load("Bode_result_shunted.mat")
plot(data.OMEGA,data.MAG)
xlabel('Omega (rad/s)'), ylabel('Magnitude')

채택된 답변

Luuk van Oosten
Luuk van Oosten 2019년 11월 14일
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
Shane Palmer
Shane Palmer 2019년 11월 15일
Thank you very much, I was not able to find those solutions, they solved the problem! Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by