Dimensions of arrays being concatenated are not consistent.

3 views (last 30 days)
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.

Accepted Answer

Stephen23
Stephen23 on 27 Sep 2021
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:

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices 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!