MATLAB:具有矩阵数据的散点图

MATLAB: Scatter Plot with matrix data

我正在尝试使用以下代码在 MATLAB 上执行 XY 矩阵的散点图,每个矩阵的大小为 54x365。数据提取自 excel.

clc
clear
A = xlsread('Test_data.xlsx', 'Sheet 1', 'F3:NF56');
B = xlsread('Test_data.xlsx', 'Sheet 2', 'F3:NF56');
scatter (A,B)

虽然它们的大小相似,但 MATLAB 会生成以下语句:

Error using scatter (line 44)
X and Y must be vectors of the same length.

Error in Untitled2 (line 11)
scatter(A,B)

注意以下几点:

A = [ A, B, C, D, E ;
      F, G, H, I, J ]

B = [ a, b, c, d, e ;
      f, g, h, i, j ]

绘制变量(A,a)(B,b)等以生成散点图。

我需要帮助来绘制散点图。谢谢。

将数组重塑为行向量可能允许 scatter() 函数绘制数据。在这里,数组被重塑为每个数组中 Number_Of_Values 的维度为 1。

%Generating random test data%
A = rand(54,365);
B = rand(54,365);

%Reshaping to allow plotting%
Number_Of_Values = numel(A);
A = reshape(A,[1 Number_Of_Values]);
B = reshape(B,[1 Number_Of_Values]);

scatter(A,B);

运行 使用 MATLAB R2019b