Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



symbolic in FOR loop. not run...WHy??
Posted:
Dec 21, 2012 1:24 PM


Helloo all, I may put a question about symbolic & for loop. I AM USING FOR loop to construct functions as following:
(MFILE) syms x y for i=1:4 N(i,1)=(x1)*(y1);N(i+4,1)=(x5+i)*(y2); N(i,2)=(xi+1)*(y1);N(i+4,2)=(x4+i)*(y2); N(i,3)=(xi+1)*(y);N(i+4,3)=(x4+i)*(y1); N(i,4)=(x1)*(y);N(i+4,4)=(x5+i)*(y1); end (RUNNING ERROR) ? The following error occurred converting from sym to double: Error using ==> sym.double at 25 DOUBLE cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use the VPA function instead.
Error in ==> poiosnfem_trial at 41 N(i,1)=(x1)*(y1);N(i+4,1)=(x5+i)*(y2);
WHY?? I DONT UNDERSTAND AT ALL. please, ANY IDEAS!



