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

### Error in fsolve: CAT arguments dimensions are not consistent

• Email
• Follow

```I try to solve a couple of nonlinear equations with the following function
--------------------
function F = SolveNG(x,cx,cy,cz,ax,ay,az,P4,P5,CP)
n = cross(P4-CP',P4-P5);
n = n(:).'/norm(n)
D1 = -n(1,1)*P4(1,1) - n(1,2)*P4(1,2) - n(1,3)*P4(1,3)

P1=P4(1,1);
P2=P4(1,2);
P3=P4(1,3);
N1=n(1,1)
N2=n(1,2)
N3=n(1,3)
F = [N1*x(1) + N2*x(2) + N3*x(3) + D1;
((x(1)-cx)/ax)^2 + ((x(2)-cy)/ay)^2 + ((x(3)-cz)/az)^2 -1;
((2*(x(1)-cx))/(ax^2))- x(4);
((2*(x(2)-cy))/(ay^2))- x(5);
((2*(x(3)-cz))/(az^2))- x(6);
x(4)*x(1) + x(5)*x(2) + x(6)*x(3)+ x(7);
x(4)*P1 + x(5)*P2 + x(6)*P3+ x(7)];
end
-------------------

In the main function I use this code to call my function
-------------------
x0 = [-80; -40; -40;-30;-30;-30;-30];           % Make a starting guess at the solution
options=optimset('Display','iter');   % Option to display output
fsolve(@SolveNG, x0, options, cx,cy,cz,ax,ay,az,P4,P5,CP)
------------------

But I get an error which I do not understand:
??? Error using ==> vertcat
CAT arguments dimensions are not consistent.

Error in ==> SolveNG at 12
F = [N1*x(1) + N2*x(2) + N3*x(3) + D1;

Error in ==> fsolve at 253
fuser = feval(funfcn{3},x,varargin{:});

Error in ==> TestSimpeSphere at 726
fsolve(@SolveNG, x0, options, cx,cy,cz,ax,ay,az,P4,P5,CP)

Caused by:
Failure in initial user-supplied objective function evaluation.
FSOLVE cannot continue.

How can I solve this??
```
 0

See related articles to this posting

0 Replies
620 Views

Similar Articles

12/8/2013 9:03:59 AM
page loaded in 59255 ms. (0)

Similar Artilces:

What is a good way to edit SWT objects from other threads? Any comments would be greatly appreciated. Thanks, Leo Bayer

Column assignment over multiple dimensions
dimensions. For instance, assume I have the following array: X = zeros(100,50,2,100); I need something that would be the equivalent of the following: X(:,1:8,:,:,1) = P(1,1:8); (except that this command won't work, for the reasons described above... you get the "??? Subscripted assignment dimension mismatch" error). Right now I just do the following every time I have to do this: for Y=1:8 X(:,Y,:,:,1) = OfrPts_P(1,xx); end Thx for any help! T "Tom" <tdd214dontspam@gmail.com> wrote in message <gphut5\$nps\$1@fred.mathworks.com>... > I can

No debug messages logged to console?
Hi. I have enabled "debug ip packet" on a Cisco 3750 switch. I am connected via the console port and using HyperTerminal. I am unable to see any debugging messages? Any ideas? Thanks, Paul On Jun 27, 7:28 am, "thefun...@aol.com" <thefun...@aol.com> wrote: > Hi. > > I have enabled "debug ip packet" on a Cisco 3750 switch. > > I am connected via the console port and using HyperTerminal. I am > unable to see any debugging messages? check if console logging has beend disable using the show logging command Lightning#sh logging Syslog lo

MW: what happened to TESmods?
the site has been down for some time now (www.tesmods.net) ? -- "This is an extremely primitive and paranoid culture." (James T. Kirk on 20th century America, Star Trek IV) Cole Turner <remove.cole.turner@liwest.at.spambotprotection> wrote in news:b75k71ptv0h11u0bi3kr4n0ed5ks88ooob@4ax.com: > the site has been down for some time now (www.tesmods.net) Try http://tesrealm.com/index.php or http://www.tes4.com/index.php C > the site has been down for some time now (www.tesmods.net) > > ? They ran out of bandwidth and couldn't afford to stay up. There was

how to read all the arguments
using \$# we will get number of aurguments where in \$1 is first argument where in \$2 is secound argument and so on how can i get last 3 arguments (here i don't know how many arguments will passed) i.e suppose if you give n arguments i have to get last three arguments On 2007-04-16, siva18kumar@gmail.com <siva18kumar@gmail.com> wrote: > using \$# we will get number of aurguments > where in \$1 is first argument > where in \$2 is secound argument > and so on > > how can i get last 3 arguments (here i don't know how many arguments > will passed) > > i.e suppose if you give n arguments i have to get last three arguments > Ask in comp.unix.shell -- Ignorance more frequently begets confidence than does knowledge: it is those who know little, not those who know much, who so positively assert that this or that problem will never be solved by science. [email me at huge {at} huge (dot) org <dot> uk]

Where is the device tree for network devices
Hello In our Solaris machines (Sol 9) even though we can see the device tree of the network cards (on-board as well as the PCI) in the OBP as well as the /etc/path_to_inst file. But I am unable to find the device under /devices/pci..... Can anyone help? Yours truly Renjith V.

SWINE FLU H1N1 VIRUS SYMPTOMS MEASURES PRECAUTIONS TREATMENT VACCINE .
SWINE FLU H1N1 VIRUS SYMPTOMS MEASURES PRECAUTIONS TREATMENT VACCINE . CHECK OVERALL INFORMATION ON WHAT IS SWINE FLU AT http://knowledgeatheaven.blogspot.com/2009/09/swine-flu.html SYMPTOMS PRECAUTIONS MEASURES OF SWINE FLU ARE PRESENTED IN ABOVE BLOG . PULI LINKS : (1) Improve your knowledge quickly . Check At http://knowledgeatheaven.blogspot.com/2009/09/welcome-to-home-page.html (2) Full Relief & Fun . Visit http://www.ultimatemessages.blogspot.com/

proposal: let kind_of take more arguments
It just hit me.. why not let kind_of? take more arguments? irb(main):001:0> x = 3 => 3 irb(main):002:0> x.kind_of?(String) => false irb(main):003:0> x.kind_of?(String, Fixnum) ArgumentError: wrong number of arguments(2 for 1) from (irb):3:in `kind_of?' from (irb):3 irb(main):004:0> For instance I have def push(choice) if choice.kind_of?(Zero) == false and choice.kind_of?(One) == false raise "got #{choice.class}" end @choices << choice end It could turn into def push(choice) unless choice.kind_of?(Zero, One) raise "got #{choice.class}" end @choices << choice end -- Simon Strandgaard "Simon Strandgaard" <neoneye@adslhome.dk> schrieb im Newsbeitrag news:pan.2004.02.19.14.25.27.611885@adslhome.dk... > It just hit me.. why not let kind_of? take more arguments? > > irb(main):001:0> x = 3 > => 3 > irb(main):002:0> x.kind_of?(String) > => false > irb(main):003:0> x.kind_of?(String, Fixnum) > ArgumentError: wrong number of arguments(2 for 1) > from (irb):3:in `kind_of?' > from (irb):3 > irb(main):004:0>

Interesting but URGENT Case: Online Backup which never gets consistent
Hi folks, I have the (for me) interesting case that I have an online backup where I can apply all the archived redo logs I have but the database will never be consistent. What have done: 1. alter tablespace ... begin backup; 2. cp datafiles to other machine 3. alter tablespace ... end backup; 4. ALTER DATABASE BACKUP CONTROLFILE TO ...; 5. cp backup controlfile, init.ora, archived redo logs etc. to other machine On the other machine: 1. startup mount; 2. recover database using backup controlfile; 3. applied all the archived redo logs When I now try to open the database I always get the info that system.dbf needs more recovery to be consistent. When I tried to create a new control file I get the following: SQL> RECOVER DATABASE ORA-00279: change 566146715 generated at 11/07/2003 04:03:48 needed for thread 1 ORA-00289: suggestion : /shop/oracle/arch/ISTOY2/arch_1_6424.arc ORA-00280: change 566146715 for thread 1 is in sequence #6424 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /shop/oracle/arch/ISTOY2/arch_1_6425.arc ORA-00310: archived log contains sequence 6425; sequence 6424 required ORA-00334: archived log: '/shop/oracle

How to calculate the number of arguments a function takes. (its arity).
Hello, Is there a portable way to calculate a function's arity in CL? I've skimmed the CLtL2 book without success. I suppose it can't be done because a function can take optional arguments... I'm I missing something obvious? If there is no way... How would you approach that need? I'm doing a genetic programming library and I want operators to be functions taking an unspecified number of arguments. I'd like to apply them this way: (let ((operator (select-operator-from-weighted-list operators-list)) (apply operator (select-n-individuals (arity-of operator) population))) That would be the clean, desirable way. Unfortunately there is no arity-of function. :( Right now I'm creating operators as subclasses of a CLOS class called operator which has an arity attribute. And the operator is implemented as a method taking an object of that class and the individuals as arguments. But it is ugly code. I've also thought about implementing it as a macro which would add an 'arity' property to the function's property list, but I've never used property lists. Would it be possible? How