2 views (last 30 days)
Hi, I'm a fairly new user of Matlab, and I set up a list of variable definitions like so:
This list is used to define variables for these 3 equations to be solved simultaneously:
When I run the .m file, however, I get an error at z=(n-1i.*k) saying that n is an 'undefined variabe'. n is supposed to be undefined, as I solve for it later. How can I resolve this? Also, is there a way to put Matlab code into these entries to help organize them?
Sean de Wolski on 8 Feb 2012
Do you have the symbolic toolbox? If you do, define n as a symbolic variable
and then you can do exactly what you were talking about. Else defined it as an input to an anonymous function that you could later solve with fsolve (Optimization toolbox).