You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: displayData.m
    path of file: ./repos/Machine-Learning-Andrew-Ng/matlab/ex3
    
    the code of the file until where you have to start completion: function [figurePane , display_array] = displayData(X,image_width)
%% 函数说明：把输入的图像数据X进行重新排列，显示在一个面板figurePane中，面板中有多个小imge用来显示每一行数据
% image_width：每一个小imgae的宽度
% 获取X的具体尺寸
[m,n] =size(X);

    
function [figurePane , display_array] = displayData(X,image_width)
%% 函数说明：把输入的图像数据X进行重新排列，显示在一个面板figurePane中，面板中有多个小imge用来显示每一行数据
% image_width：每一个小imgae的宽度
% 获取X的具体尺寸
[m,n] =size(X);

%% 设置每一个image的尺寸
% 如果没有设置image_width，就默认为是数据维度的开平方，并四舍五入
if ~exist('image_width','var') || isempty(image_width)
    image_width = round(sqrt(n));
end