MATLAB: Error “createcharmatrix” please help me

error

syms h;
A=sym('h',zeros(6,6));
for k=1:6
A(1,k) = 1;
end
for i=2:6
for j=2:6
A(i,j) = (((j-1)^(i-1))./(factor(i-1))) .* (h .^ (i-1));
end
end
B=sym(zeros(6,1));
B(1,4)=1;
C = inv(A)*B;
disp(C);
I want to create matrix with 'h' and solve this another numerical matrix. But i don't know where making mistake. Please help me.

Best Answer

Change
A=sym('h',zeros(6,6));
to
A = zeros(6,6,'sym');
However you will still get a failure, because factor(i-1) can return a vector. Is it possible that you intended factorial() ?