0

This is my code

syms xi eta
    N1 = ((1+xi)*(1+eta))/4;
    N2 = ((1-xi)*(1+eta))/4;
    N3 = ((1-xi)*(1-eta))/4;
    N4 = ((1+xi)*(1-eta))/4;
    Nxieta = [N1 N2 N3 N4];
    difNxieta = sym(zeros(2,4))
    for i = 1:4
        difNxieta(1,i) = diff(Nxieta(1:i),xi);
        difNxieta(2,i) = diff(Nxieta(1:i),eta);
    end

And this is the error it showed me

Unable to perform assignment because the size of the left side is 1-by-1 and the
size of the right side is 1-by-2.

Error in sym/privsubsasgn (line 1128)
                L_tilde2 =
                builtin('subsasgn',L_tilde,struct('type','()','subs',{varargin}),R_tilde);

Error in sym/subsasgn (line 965)
            C = privsubsasgn(L,R,inds{:});

Error in Ae420_FEA_project>localstiffnessmatrix (line 55)
        difNxieta(1,i) = diff(Nxieta(1:i),xi);

But I don't understand. diff(Nxieta(i:1),xi) is not an array.

beaker
  • 16,331
  • 3
  • 32
  • 49
Faito Dayo
  • 115
  • 4

0 Answers0