useful matlab functions

Jun 08 2012 Published under Mathematics

diff(y, x) - differentiate y with respect to x
solve ( eqn, x) - solve for x in eqn
char(x) - convert symbolic x to characters
strcat()
dsolve(eqn1,eqn2,eqn3) - solve differential equations 
ezplot(somefunctions, [0 range])
subs(someSymbolicFunctions) 
vpa(someSymbolicFunctions)
struct()
initial()

example usage


eq3b = strcat(char(subs(sol_h.p1,'t',2)),'=',char(subs(sol_h.x1,'t',2)),'-5');

sol_b2 = struct('x1',{subs(sol_h.x1)},'x2',{subs(sol_h.x2)},'p1',...
                 {subs(sol_h.p1)},'p2',{subs(sol_h.p2)});

sol_book = {@(t)(2.697*t-2.422+2.560*exp(-t)-0.137*exp(t)),...
            @(t)(2.697-2.560*exp(-t)-0.137*exp(t))};
time = linspace(0,2,20);
s_book = [sol_book{1}([time);sol_book{2}(time)];

[Y,X,t]=initial(A-B*K,BIN,C,D,XO,tfinal);

Comments Off

Comments are closed at this time.

Login