how to input the Equations which has some variables
Ältere Kommentare anzeigen
syms v1 v2 v3 c1 c2 c3 e1 e2 e3 c1=0; c2=0; c3=0; v=[v1; v2; v3; ]; c=[c1; c2; c3; ]; e=[e1; e2; e3; ]
r=[0 5 3; 5 0 4; 3 4 0]; %r(3,2)
for i=1:3 for j=1:3 if(i~=j) c(i)=c(i)+(v(i)-v(j))/r(i,j); % error!!! end end e(i)=c(i); end
for i=1:3 e(i) end
What can I do about the error?
The following error occurred converting from sym to double: Error using mupadmex Error in MuPAD command: 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 equivalent_resistance_matrix (line 22) c(i)=c(i)+(v(i)-v(j))/r(i,j); % If the input expression contains a symbolic variable, use the VPA function instead.
Antworten (1)
xu wa
am 15 Okt. 2014
0 Stimmen
Kategorien
Mehr zu Common Operations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!