Hi All, How to solve this Error .........."Error using horzcat Dimensions of matrices being concatenated are not consistent."

1 view (last 30 days)
I'm trying to do a boxplot from a structure data, each cell of the structure have different size row. I want to draw 26 boxplots in the same figure using the structure data. My code is the following:
for k=1:col boxplot(dataPBL.Smooth{:,k}) end
But does not work, help me, please. Thank you.
  2 Comments
Jonnathan  Cespedes
Jonnathan Cespedes on 19 Oct 2018
Edited: Guillaume on 19 Oct 2018
clear; close all; clc;
[FileName,DirName] = uigetfile('*.*','Select the PBL Files','MultiSelect','on');
M = zeros(size(FileName));
for k=length(FileName):-1:1
fid = fopen(FileName{k},'r');
[filepath, Name, ext] = fileparts(FileName{k});
Name = strcat(Name,ext);
dataPBL.FileName{:,k} = FileName{:,k};
dataPBL.Ptop{:,k} = dlmread(fullfile(DirName,FileName{:,k}));
% [dataPBL.Envelope{1,k}, dataPBL.Envelope{2,k}]= envelope(dataPBL.Ptop{:,k}(:,2));
dataPBL.Smooth{1,k} = smooth(dataPBL.Ptop{:,k}(:,1),dataPBL.Ptop{:,k}(:,2),0.03,'rloess');
end
clearvars -except dataPB
I'm using this code, and i attached two files of data.

Sign in to comment.

Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!