"From my understanding there is no need for the number of coloums to be the same"
If the number of columns in the key variables are not the same then there a no matches and the whole exercise is moot.
"the ML examples don't have this aswell"
uses key variables with exactly one column. The only variable on the entire page that consists of multiple columns is "BloodPressure", which is not used as a key variable.
As far as I can tell, you are confusing the number of columns in the tables (which is not important) with the number of columns in the key variable (which is what your error message is about).
Your error is easy to demonstrate:
T1 = table(X,A)
T1 =
X A
_ ___
A 111
B 123
C 456
T2 = table(X,B)
T2 =
X B
_ ___
C 222
B 444
T3 = table(X,C)
T3 =
X C
__ ___
AA 333
BB 666
CC 999
join(T2,T1,'keys','X')
ans =
X B A
_ ___ ___
C 222 456
B 444 123
join(T3,T1,'keys','X')
Error using tabular/join
Left and right key variables 'X' and 'X' do not have the same number of columns.
"I have already performed a sequence to allign the data types of the Keyvar (SER_AKTUATOR) and they are both 'Char'"
And that is the cause of the problem.
"Does anyone know how what the problem is/ ho to fix it?"
Easy, simply replace that variable (a character array) with either of these:
- a cell array of character vectors
- a string array
with one column.