how to remove the error "Dimensions of matrices being concatenated are not consistent."?

2 ビュー (過去 30 日間)
Muhammad
Muhammad 2021 年 9 月 2 日
編集済み: Muhammad 2021 年 9 月 2 日
clc
clear all
for i6=1:length(nrotName)
% infileName(i1)= snameExt,nfileName(i1),nmovName(i2),nrepName(i3),nfTime(i4),ndataName(i7),nsegName(i5),nrotName(i6);
% infileName(i1) = dataset.(nfileName).(nmovName).(nrepName).(nfTime).(nsegName).(nrotName).jointAngle;
infileName = dataset.(fileName{i1}).(movName{i2}).(repName{i3}).(nfTime{i4}).(nsegName{i5}).(nrotName{i6}).(jointAngles);
for k = 1: length(infileName)
A=[];
B=[];
B(k)= (infileName(k));
x = linspace(0, 100, length((B(k))));
y = 1:100;
A(k) = spline(x, [B(k) y]);
normalized.(infileName(k))=(A(k));
end
end
end
end
end
end
end
error is coming
Dimensions of matrices being concatenated are not consistent.
  3 件のコメント
Muhammad
Muhammad 2021 年 9 月 2 日
>> incorporatingdataset
Dimensions of matrices being concatenated are not consistent.
Muhammad
Muhammad 2021 年 9 月 2 日
this is a complete error

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

採用された回答

Jan
Jan 2021 年 9 月 2 日
編集済み: Jan 2021 年 9 月 2 日
I guess, the error occurs in this line:
nsegName= ["L5S1","L3L4","T12L1","T8T9","C7T1","C1Head","RT4Shoulder","RShoulder","RElbow","RWrist","LT4Shoulder","LShoulder","LElbow","LWrist",
"RHip","RKnee","RAnkle","RBallFoot","LHip","LKnee","LAnkle","LBallFoot"];
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
The problem is the missing line continuation at the end. Append a "...":
nsegName = ["L5S1","L3L4","T12L1","T8T9","C7T1","C1Head","RT4Shoulder","RShoulder", ...
"RElbow","RWrist","LT4Shoulder","LShoulder","LElbow","LWrist", ...
"RHip","RKnee","RAnkle","RBallFoot","LHip","LKnee" ,"LAnkle","LBallFoot"];
Your code can be simplified:
nfileName = "Mert";
load('dataset.mat')
nmovName = "AOG"; %,'FUZ','FUZY','MaW','NoW','OAK'};
nrepName = ["Bir", "iki", "uc"];
nfTime = ["TO"];%'TS'};
nsegName = ["L5S1","L3L4","T12L1","T8T9","C7T1","C1Head", ...
"RT4Shoulder","RShoulder","RElbow","RWrist","LT4Shoulder", ...
"LShoulder","LElbow","LWrist", "RHip","RKnee","RAnkle", ...
"RBallFoot","LHip","LKnee","LAnkle","LBallFoot"];
nrotName = ["_x","_y","_z"];
for i1 = 1:length(nfileName)
for i2 = 1:length(nmovName)
for i3 = 1:length(nrepName)
for i4 = 1:length(nfTime)
for i5 = 1:length(nsegName)
for i6=1:length(nrotName)
infileName = dataset.(fileName{i1}).(movName{i2}).(repName{i3}).(nfTime{i4}).(nsegName{i5}).(nrotName{i6}).(jointAngles);
for k = 1: length(infileName)
B = infileName(k);
x = linspace(0, 100, length(B));
y = 1:100;
A = spline(x, [B, y]);
normalized.(infileName(k)) = A;
end
end
end
end
end
end
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFunction Handles についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by