Why do I get "Error using plot, Data cannot have more than 2 dimensions"
43 ビュー (過去 30 日間)
古いコメントを表示
I am following the model "Sense Motion Using a Transform Sensor Block" in the Help Center. When I try to plot the figure it gives me this error:
plot(y_link.data, z_link.data, 'color', [60 100 175]/255);
Error using plot
Data cannot have more than 2 dimensions.
I am using Matlab R2022a
採用された回答
Daksh
2023 年 2 月 3 日
I understand that you're facing the error: "Error using plot, Data cannot have more than 2 dimensions" in your utility.
We know that MATLAB command "plot(X,Y)" creates a 2-D line plot of the data in Y versus the corresponding values in X.
- To plot a set of coordinates connected by line segments, specify X and Y as vectors of the same length.
- To plot multiple sets of coordinates on the same set of axes, specify at least one of X or Y as a matrix.
Kindly navigate to the workspace variables and check the dimensions and data types for both variables "y_link.data" and "z_link.data". Make sure that the data variables have consistent and appropriate dimensions and are 1 dimensional arrays.
Hope it helps!
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!