COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### how to use fsolve

• Email
• Follow

i tried to use fsolve for solving the set of two non linear equations as given in the product help of the matlab but i got an error "??? Input argument "x" is undefined.

Error in ==> myfun at 2
F = [2*x(1) - x(2) - exp(-x(1));
"
How to use fsolve to solve set of two simple non linear equations..
 0

See related articles to this posting

"Pappu Kumar" <nawagarh@yahoo.co.in> wrote in message <i7dktk\$24l\$1@fred.mathworks.com>...
> i tried to use fsolve for solving the set of two non linear equations as given in the product help of the matlab but i got an error "??? Input argument "x" is undefined.
>
> Error in ==> myfun at 2
> F = [2*x(1) - x(2) - exp(-x(1));
>  "
> How to use fsolve to solve set of two simple non linear equations..

Apparently x isn't defined:

function out = myfun(x)
out = [2*x(1) - x(2) - exp(-x(1));
end

Perhaps you meant that?
 0

1 Replies
526 Views

Similar Articles

12/13/2013 4:39:55 AM
page loaded in 4402 ms. (0)

Similar Artilces:

Optimization using fsolve
Hi, As the normal way to use fsolve is x = fsolve(fun,x0) is it posisble to have x = fsolve(fun,g(x0)) I mean first I calculate g(x) through x, and I want to minimize fun with g(x) instead of (x) and finally I want to know what is x Many Thanks in Advance! Jie "Jie " <jz286@cam.ac.uk> wrote in message news:h901c8\$b3q\$1@fred.mathworks.com... > Hi, > > As the normal way to use fsolve is x = fsolve(fun,x0) > > is it posisble to have x = fsolve(fun,g(x0)) > > I mean first I calculate g(x) through x, and I want to minimize fun with > g(x) instead ...

Hi, Im trying to perform a system identification task where I have a simulink model of a system for which I don't know the parameters. I have a good idea of the transfer function for this physical system and some test data. I am trying to use fsolve to vary the system parameters for me, but it seems to very each of the parameters once each by a very small amount, then for some reason fsolve sets the parameter vector to nans. Any advice on what I can do to prevent this and achieve a real convergence would be massively appreciated. I've been trying to solve this problem for weeks! O...

problem in using function "fsolve"
Hi all the function "fsolve" solves a system of equations My system includes 3 equations which I created a mfile for the system. In the file I put: function F = bifun(x,e) F =[2*x(1)*e(2)+x(2)*e(3)+x(3)*e(4)+x(2)*e(5)+x(3)*e(8); x(1)*e(3)+x(1)*e(5)+2*x(2)*e(6)+x(3)*e(7)+x(3)*e(9); x(1)*e(4)+x(2)*e(7)+x(1)*e(8)+x(2)*e(9)+2*x(3)*e(10)]; I have the values for e and want to find out the x values using "fsolve". The problem is I don't konw how to write the function so it will read the values for e, so the system become one with 3 equations 3 unkonwn(x(1),x(2),x(3))...

Using Solve/FSolve for Multiple Trig Equations
Hello, I am trying to solve for: y r p in the following equations where I, J, K are known. I = siny * sinr + cosy * sinp * cosr J = -siny * cosr + cosy * sinp * sinr K = cosy * cosp The code I have used is: syms r p y i j k S = solve(i == sin(y)*sin(r)+cos(y)*sin(p)*cos(r), j == -sin(y)*cos(r)+cos(y)*sin(p)*sin(r), k == cos(y)*cos(p)) S.r S.p S.y but I cannot seem to get a result. Any help would be appreciated. Thank you, On 5/1/2013 11:16 AM, Jung wrote: > Hello, > > I am trying to solve for: > y > r > p > > in the followin...

calling value of variable from main program into myfun while using fsolve
Hi, i am trying to solve system of nonlinear equations using fsolve and myfun is : function F=myfunt(y) x1=10; y1=5*sind(x1); theta1=90+atand(-1/5*cosd(x1)); x2=x1-2*sind(theta1); y2=y1+2*cosd(theta1); F=[y(1)-x2+10*cosd(y(2))-2*sind(90+atand(-1/5*cosd(y(1)))); 5*sind(y(1))-y2+10*sind(y(2))+2*cosd(90+atand(-1/5*cosd(y(1))))]; here i have to provide x1 for each time i want to solve it .but i want function myfunt to take value of x1 from main program so that i can solve this system of NLE for different value of x1. please help. thanx. "deepak " <dkjknobel@...

Just When I Was Getting Used To Using Using
I have a class Packet that contains a nested class Payload and an enumeration: struct Packet { struct Payload { } ; } ; I had gotten into the habit of writing: using Packet::Payload; so I could write: Payload::..blah.. instead of Packet::Payload::..blah I have done this... (gulp) in many, many .cpp files. I tried out the new Visual C++ Express compiler from you-know-who on my source code and got 1000's of error messages: ...\Packet\Packet.cpp(13) : error C2885: 'Packet::Payload': not a valid using-declaration at non-class scope What does the standard say? Is th...

ActGen to use or not to use?
Hello, I was doing a project with Actel FPGA ex128 with Libero Platinum Eval version software. in my project I had to use some counters,Multiplexers etc. which I wrote myself. Now as I was a beginner I didnt use the ActGen. Is it worth the effort to write the code partly by using ActGen macros for counter and muxes and etc. Thanks Naimesh Naimesh wrote: > I was doing a project with Actel FPGA ex128 with Libero Platinum Eval > version software. > > in my project I had to use some counters,Multiplexers etc. which I > wrote myself. Good work. Writing your own code makes y...

file in use, could not use
Hi. I have two databases that are both linked to the same backend table. I can't use them both at the same time, yet other users can have both functioning simultaneously on their machines. Opening them is not the problem. ..but the error message appears when I run any queries linked to the table. It works in one database, but not the other. All users are running XP sp2 with Access 2003. The error message is the same regardless if anyone is using the backend or not. I believe it is machine specific...MY machine. I haven't a clue. Any ideas? -- Message posted via http://www.accessmon...

To use or not to use neural networks?
Hi, my name is Conrad and I'm guessing that I sould use neural networks for my project. BTW, I'm interested in building a system that mimics an actual human (i.e. myself). Thus, it needs the ability to be able to learn as an actual human. Thus, I'm wondering, is neural networks the way to go for this particular project? If so, are there any books and/resources that can assist me in creating this project. Also, I have purchased the 'Neural Smithing..." book but I would be interested in other appropriate recommendations. Thanks in advance, -Conrad Con wrote: > Hi...

using run with net use
Hi, I start "net use" with the run-command in a clipper 5.2e program under Win2000. This runs perfectly on my system. Now I want to run it on another PC, and it does not work. I already checked the config.nt and autoexec.nt files. They are the same. I think its something with the memory, but where can I check this. Josef Josef, Does the command work if you use from the command line on "another" PC? Josef, >I start "net use" with the run-command in a clipper 5.2e program under >Win2000. This runs perfectly on my system. Now I want to run it on >ano...

USE and EC-FLOW-USE
As I understand it, EC-FLOW-USE is a sort of indicator for possible recursive USE directives. But what is supposed to happen in this situation ? And how to detect it ? Roger "Roger While" <simrw@sim-basis.de> wrote in message news:e69kf1\$g8i\$00\$1@news.t-online.com... > As I understand it, EC-FLOW-USE is a sort of > indicator for possible recursive USE directives. > But what is supposed to happen in > this situation ? > And how to detect it ? Using WD 1.6 as the reference: Page 584, 14.8.45.3 USE statement, General rules, "2) During the execution of a ...

using setTimeout when using prototype
I have an object, and I define the following: var processForm=new Object(); processForm=function(inservleturl) { this.inservleturl = inservleturl; this.submitForm(); } processForm.prototype.submitForm2=function() { } processForm.prototype.submitForm=function() { setTimeout("submitStep2()", 20); } How can the submitForm function's setTimeout call submitStep2? Thank you. processForm=function(inservleturl) { this.inservleturl = inservleturl; this.submitForm(); } processForm.prototype.submitForm2=function() { ...

How to use not while greping using Regex
Hi, I would like to know how to use 'Not' option while grepping using regex I have a file "File1.txt" whose contents are as below ---- INFO: error did not occur ERROR: an error has occured INFO: the machine has been started --- cat File1.txt | grep '\error' ----> returns both the lines which has error I would like to retrieve only the lines which has "error" but not "Info" I appreciate your help. Thanks in advance Regards, Fahad On Mon, Jan 08, 2007 at 01:36:04AM -0800, Kimi wrote: > > I would like to retrieve only the lines whic...

How to use LDAP using PHP
Heylo, I have installed PHP and make the necessary changes required in PHP.ini the changes were uncommenting LDAP and GD files. after that i had run PHPinfo command thru web page and it was not showing me both LDAP and GD config. Is i am doing sumthing worng if yes plz guide else tell me sum solution for how to go further. You may need to restart the web server if you're using mod_php. I would double-check that the Configuration File (php.ini) Path setting shown by phpinfo() is the file that was updated... On Jan 31, 8:39 am, dilipbail...@gmail.com wrote: > Heylo, I have installed PH...

Do not use Cypress use philips.
"Sergey Uskach" <sergeyuskach@hotmail.com> wrote in message news:JQNQd.23005\$ya6.3812@trndny01... > > I completely agree, when I need a screwdriver I go for Philips nearly every time. Peter Peter wrote: > I completely agree, when I need a screwdriver I go for Philips nearly every > time. Well, I only partly agree. If the screw I want to use is philips I tend to use such a tool also. However if it's something else I guess a cypress would fit as badly and could even hurt the screw. If I were to construct something new I would use torx instead. Muc...

How to use use VESA modes?
What is VESA modes? How i do program that uses VESA modes? How to enable VESA mode? svetoslav belchev schrieb: > What is VESA modes? Ask Google. > How i do program that uses VESA modes? Depends on what you are using to program with. Ask Google. > How to enable VESA mode? VESA modes are available if your PC has a VESA driver installed; this could be in the gfx card BIOS or as a RAM-resident driver that you have to load. Ask Google. Michael -- Feel the stare of my burning hamster and stop smoking! > What is VESA modes? > How i do program that uses VESA modes? > How to ...

How to use office phones for home use?
I have always wondered whether networked office phones can be converted to regular phones for use at home. Please advise. Thanks. It depends on the make and model of phone. If they're proprietary "digital" phones they will only work with the KSU or PBX they were intended for so you would need that too. Even if a particular office phone could be connected directly to your home phone line it may not have any feature operations without the benefit of the KSU or PBX central equipment. Do you have a specific phone in mind? From:domenic__@hotmail.com domenic__@hotmail.com &g...

using-declaration vs. using-directive
In FAQ 15.03, it is stated, "Note that a using directive does not declare any variables; it merely makes names available." No similar mention is made for using-declarations. Based on the name alone, I assume using- declarations DO declare variables. Is this assumption correct? If so, what's the practical difference between one of them declaring a variable, and the other not? For that matter, what the theoretical difference? Insert Pseudonym Here wrote in news:Xns94DDEDA7A9178iphiphfakeaddrcom@68.12.19.6 in comp.lang.c++: > In FAQ 15.03, it is stated, "Note tha...

where to use CPLD & where to use FPGA?
Hi i am new VLSI technology. can anybody suggest me the criteria for choosing FPGA/CPLD for design. which parameters play imp role in distingwishing them? any guidline for that. They way i distinguish between the two is: CPLD -Instant On -Non-volatile -Reconfigurable* -Fixed Path Delays -Low/Medium size. FPGA -Setup Time -Volatile -Reconfigurable -Good for large designs. With these points in mind CPLD is normally good for control applications and logic soaking, FPGA is good for complex designs rich in register utilisation. <kulkarku@math.net> wrote in message news:1141300551.6...

Trying to use gsub using variables
I need to be able to match and substitute text in a string and I'm trying to use gsub with no luck....probably because it's looking for an regular expression. Does anyone know how I can achieve this same thing using another method perhaps? Here is my code that is not working: x = "NEW_WORD" acl.gsub!(/WORD_TO_MATCH_AND_REPLACE/, x ) thanks jackster -- Posted via http://www.ruby-forum.com/. jackster the jackle wrote: > Here is my code that is not working: > > x = "NEW_WORD" > acl.gsub!(/WORD_TO_MATCH_AND_REPLACE/, x ) > the x is fine, you...