Wouter Slechten
2015-12-22 21:01:03 UTC
Hello guys, I'm prety new to matlab and i'm trying to solve a differation equasion. I'm using the following .m function I wrote :
function u = onzekerheid(m1,m2,m12,mb,u1,u2,u12,ub)
syms s1 s2 s12 sb;
X(s1,s2,s12,sb) = s1*s2-s12*sb;
Y(s1,s2,s12,sb) = s1*s2*(s12+sb)-s12*sb*(s1+s2);
Z(s1,s2,s12,sb) = Y*(s1+s2-s12-sb)/(X)^2;
t(s1,s2,s12,sb) = X*(1-sqrt(1-Z))/Y;
O(s1,s2,s12,sb) = sqrt([diff(t,s1)*u1]^2+[diff(t,s2)*u2]^2+[diff(t,s12)*u12]^2+[diff(t,sb)*ub]^2);
M = O(m1,m2,m12,mb);
u = M;
end
after that I call for the function 'onzekerheid' from the command window inputting my found values. The command i use for this is :
onzekerheid-1(55.945556,23.218889,77.716667,0.248889,0.965598699,0.622019235,1.138058793,0.063498192)
(note: I saved the file as onzekerheid-1 that's why i call it like this when inputting)
I get this error when trying to input it Error: Unbalanced or unexpected parenthesis or bracket. Any ideas how to fix?
function u = onzekerheid(m1,m2,m12,mb,u1,u2,u12,ub)
syms s1 s2 s12 sb;
X(s1,s2,s12,sb) = s1*s2-s12*sb;
Y(s1,s2,s12,sb) = s1*s2*(s12+sb)-s12*sb*(s1+s2);
Z(s1,s2,s12,sb) = Y*(s1+s2-s12-sb)/(X)^2;
t(s1,s2,s12,sb) = X*(1-sqrt(1-Z))/Y;
O(s1,s2,s12,sb) = sqrt([diff(t,s1)*u1]^2+[diff(t,s2)*u2]^2+[diff(t,s12)*u12]^2+[diff(t,sb)*ub]^2);
M = O(m1,m2,m12,mb);
u = M;
end
after that I call for the function 'onzekerheid' from the command window inputting my found values. The command i use for this is :
onzekerheid-1(55.945556,23.218889,77.716667,0.248889,0.965598699,0.622019235,1.138058793,0.063498192)
(note: I saved the file as onzekerheid-1 that's why i call it like this when inputting)
I get this error when trying to input it Error: Unbalanced or unexpected parenthesis or bracket. Any ideas how to fix?