Matrix dimensions must agree.
Show older comments
q=sum(q_)';
pr= [0.2 0.5 1 1.5];
b0_(i,:)=pr.*((f_(1,:)')-M*(f_(1,:)').*(D1*(f_(1,:)'))-g.*M*(1+2.*y.*g).*((f_(1,:)').^2));
b1_(i,:)=-2*y.*g;
b2_(i,:)=pr*(M*(f_(1,:)').^2);
b0=diag(b0_(i,:));
b1=diag(b1_(i,:));
b2=diag(b2_(i,:));
B=b0*D1+b1*D2+b2;
B1=B(1:N,1:N); % First B.C is imposed
B2=B(2:N-1,1:N);
B3=[D1(1,1:N);A2;D1(N+1,1:N)]; % Second and third derivative B.Cs are imposed
d=D2(2,1:N);
k=pr*((f_(1,:)').*(D1*q_(1,:)')+M*((f_(1,:)').^2).*(D2*q_(1,:)')-M*(f_(1,:)').*(D1*(f_(1,:)')).*(D1*(q_(1,:)'))-...
M*(1+2.*y.*g).*((f_(1,:)').^2).*(D1*(q_(1,:)')))-(1+2*g.*y).*(D2*(q_(1,:)'));
1 Comment
Give the complete code and specify which line you got error.
Undefined function or variable 'q_'.
Error in Joke (line 2)
q=sum(q_)';
Answers (1)
mariam ahmad
on 3 Nov 2017
0 votes
Categories
Find more on Resizing and Reshaping 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!