I want to combine iterations of below example in one output.

syms  x

A=[2*x x^2;x x^4];

d=1:2;

[f,g]=size(A);

for i=1:f

B(i)=subs(A(i,:),'x',d(i));

end

The above command gives two outputs(iterations).

B=

  [2,1]

B=

  [2,16]

How can I get the output as a single matrix(which contains output of both iterrations)?

Can I get the above iterations as a single matrix, given below.

B=

     [2,  1]

     [2,16]

More Shakeel Ahmed Khan's questions See All
Similar questions and discussions