Error using horzcat CAT arguments dimensions are not consistent.

Hello, I'm trying to run this script with these variables and I'm getting the error: "Error using horzcat. CAT arguments dimensions are not consistent."
Here is my script:
load clusterscomnifa.txt
clnifa = clusterscomnifa;
ctnifa = contaocorr(clnifa);
fasnifA = [];
clnifa = [];
for ii = 1:length(ctnifa)
idsiiii = find(qrfts3M.igrp == ctnifa(ii, 1));
ifas = readfastadirectp2(db3k.rdfs, idsiiii, db3k.rdid);
fasnifA = [fasnifA; ifas'];
clnifa = [clnifa; repmat(ii, length(ifas), 1)];
end
NHead1 = cellfun(@(x) x(1:indexa(find(x == '_'), 2)), mat2celllines(char(fasnifA.Header)), 'Un', 0);
NHead2 = trimall(cellfun(@(x) x((9+indexa(strfind(x, 'Organism-'):end, 1)):end), mat2celllines(char(fasnifA.Header)), 'Un', 0));
Nnifa = cell2celllines([NHead1 clnifa NHead2]);
Wnifa = fas2mat(fasnifA) * R1369;
Wpcnifa = Wnifa * princomp(Wnifa);
filomat(Wnifa, Nnifa, 'Method', 'Nj')
Heatmapcomposition(Nnifa, Wnifa)

1 件のコメント

Walter Roberson
Walter Roberson 2023 年 11 月 9 日
Time to use the debugger.
dbstop if error
run the code. When it stops, look at size() of all of the expressions in the [ ] call
For example if readfastadirectp2 can return columns of different sizes, you could get that error.

サインインしてコメントする。

回答 (1 件)

Angela Michalichyn
Angela Michalichyn 2023 年 11 月 10 日
移動済み: Voss 2023 年 11 月 10 日

0 投票

I was able to solve my problem. I converted clnifa to a cell array of strings and also checked the size as you had suggested. I transposed it and concatenated it again. Thank you for your help.

カテゴリ

製品

リリース

R2012a

タグ

質問済み:

2023 年 11 月 9 日

移動済み:

2023 年 11 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by