BigMan157 no u 103354 Posts user info edit post |
is it possible to feed in symbolics as arguments to a function? 4/15/2008 6:00:33 PM |
darkone (\/) (;,,,;) (\/) 11610 Posts user info edit post |
I really fucking wish. You can't dynamically assign variable names either. 4/15/2008 6:16:10 PM |
BigMan157 no u 103354 Posts user info edit post |
lame 4/15/2008 9:33:28 PM |
tjoshea All American 4906 Posts user info edit post |
go back to maple 4/15/2008 9:35:40 PM |
darkone (\/) (;,,,;) (\/) 11610 Posts user info edit post |
Actually, reading your question closer... what do you mean by symbolics?
You can do something like this:
%begin script.m foo1 = 3; foo2 = 5; [output1,output2]=functionname(foo1,foo2,third_argument); somenewvalue=output1+output2; %end of script
[Edited on April 15, 2008 at 9:43 PM. Reason : close tags]4/15/2008 9:42:32 PM |
Chop All American 6271 Posts user info edit post |
^yeah, i was going to say, you can use variables in function as function arguments. assuming all dimensions line up, you can use matrices, arrays, structures, etc as function arguments as well. 4/15/2008 11:23:50 PM |
BigMan157 no u 103354 Posts user info edit post |
i meant something like
%begin script.m syms d, theta; foo1 = d; foo2 = theta; [output1,output2]=functionname(foo1,foo2,third_argument); somenewvalue=output1+output2; %end of script 4/16/2008 7:41:36 AM |
Chop All American 6271 Posts user info edit post |
as long as d and theta have been defined, then yes. i'm not aware of any general symbolic equation solving. but i don't use it for that so . . . 4/16/2008 8:12:15 PM |
BigMan157 no u 103354 Posts user info edit post |
is there a way to solve for multiple variables in matlab?
like if you have
cos(x+y) - sin(z), to return a range of values for x, y,and z? 4/22/2008 3:51:35 PM |
BigMan157 no u 103354 Posts user info edit post |
indeed there is!
[xx, yy, zz] = solve('cos(x+y) - sin(z)=0', 'x, y, z')
also, god bless the simple() command
also, to my original question, yes there is 4/22/2008 4:48:44 PM |