function mainD=1; %L=0;
Pr=1;R=0.1;Sc=1;xa=0;xb=6;Lv = [-2.5:0.025:0];p = []; for i=1:length(Lv) L = Lv(i); fODE = @(x,y) [y(2); y(3); y(2)^2-y(3)*y(1)-1; y(5); -3*Pr*y(1)*y(5)/(3+4*R); y(7); -Sc*y(1)*y(7)]; BCres= @(ya,yb)[ya(1); ya(2)-L-D*ya(3); ya(4)-1; ya(6)-1; yb(2)-1; yb(4);yb(6)]; xint=linspace(xa,xb,101); solinit=bvpinit(xint,[0 1 0 1 0 1 0]); sol=bvp4c(fODE,BCres,solinit); sxint=deval(sol,xint); %%WE NEED TO PLOT for
S(i,1)=sxint(3,:); end figure(1) plot(Lv,S,'-','Linewidth',1.5); xlabel('\bf \lambda'); ylabel('\bf C_{f}'); hold onend%%While running the code following ERROR occurs:
Subscripted assignment dimension mismatch.Error in (line 17) S(i,1)=sxint(3,:);
MATLAB: Subscripted assignment dimension mismatch.
subscripted assignment dimension mismatch
Related Question
- Can it be possible to draw Fig. 4 with Pr (0 to 2) on X-axis and for different values of M=0,1,2 OR plot(Nt,-T0(5)) with M=0,1,2
- Help in using bvp4c second order ODE.
- I’m trying to solve a fourth order ordinary differential equation using the bvp4c function. However, I am getting a few errors in the code.
- Loop for bvp4c function with an unknown parameter
- How to include piecewise defined functions in bvp4c solver
- Help with plotting in a bvp4c solver
Best Answer