Dimensions of arrays being concatenated are not consistent.

조회 수: 4 (최근 30일)
Robert Demyanovich
Robert Demyanovich 2021년 9월 27일
답변: Stephen23 2021년 9월 27일
I have no idea why I am getting an error in the following code:
FluorDataInd = round(i/TimeFactor)+1
x=[ConcValues{1,1} ConcValues{1,2} ConcValues{1,3} ConcValues{1,4} ConcValues{1,5}]'; y=[FluorData{FluorDataInd,3}
FluorData{FluorDataInd,4} FluorData{FluorDataInd,5} FluorData{FluorDataInd,6} FluorData{FluorDataInd,7}]';
[cf G]=L4P(x,y)
The error I am getting is:
457 x=[ConcValues{1,1} ConcValues{1,2} ConcValues{1,3} ConcValues{1,4} ConcValues{1,5}]'; y=[FluorData{FluorDataInd,3}
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
So for the x = statement, all of the variables need to be values. For example, the following does not produce any errors"
x=[1E-07 1E-02 5E-13 1E-10 1E-04]'; y=[102.992 130.6 48.1917 51.083202 127.988]';
[cf G]=L4P(x,y)
FluorDataInd provides the row number for the table FluorData. So, I don't see what the problem is.

채택된 답변

Stephen23
Stephen23 2021년 9월 27일
The problem is the line-break without any ellipses. But your code can be simplified anyway, removing that problem:
x = [ConcValues{1,1:5}].';
y = [FluorData{FluorDataInd,3:7}].';
See also:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by