**Solve singular linear system**Hi, I'm trying to solve a linear system:
Ax = B, A is a given n by n matrix
It is known that A is singular, and if I give x1=a, x2=b then the solution is unique. How do I solve Ax = B provided x1=a and x2=b in matlab? Thank you.
"Haoran " <chr@cms.zju.edu.cn> wrote in message <k43000$rkg$1@newscl01ah.mathworks.com>...
> Hi, I'm trying to solve a linear system:
>
> Ax = B, A is a given n by n matrix
>
> It is known that A is singular, and if I give x1=a, x2=b then the solution is unique. How do I solve Ax = B provided x1=a and x2=b in ...

**solving sparse singular (linear) system**I seem to remember that in previous version of matlab the backslash
operator would try to give solutions to singular systems...I know I
could just knock out the zero rows and solve that non-singular system
but I kind of (lazily) expect there to be a one-line way to do this
in matlab.
Also, I am actually applying it to large sparse singular matrices so
pinv (pseudoinverse) is no good.
thanks ...
>> A = [ 0 0; 1 0]
A =
0 0
1 0
>> b = [ 0 1]'
b =
0
1
>> pinv(A)*b
ans =
1
0
>> A\b
Warning: Matrix is singular to working precision...

**Which method is used in MATLAB to solve square singular linear systems ?**Hello All.
My question is in the subject. I wonder which numerical technique is used in MATLAB to solve square systems with singular coefficient matrix.
Take e.g. A=[
10 10 1 -18
10 20 18 -34
1 18 29 -29
-18 -34 -29 58];
b=[50 ; 100 ; 90 ; -170];
This 4x4 system has rank 2 and MATLAB returns the solution
>> A\b
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 9.148276e-019.
ans =
16.8889
-2.6667
9.8467
5.6705
This is not the least-squares solu...

**Solving a recursive system of 3x3 linear systems...**
Hi everybody,
I'm looking at a recursive system where at each l-th step the three
variables a[i,l] (1 <= i <= 3) have to be solved from a system of three
linear equations involving the previously solved a[i,l+1], ....,
a[i,k] (1 <= i <= 3) (so the iterator l runs back, starting from some
value k). My goal is to find a closed form "direct formula" for the
a[i,l], that is a formula that expresses each a[i,l] in terms of the
starting values a[i,k]'s and the the other known constants involved.
More precisely, the code for finding the first few s...

**Solve Linear system with non-linear constrain**Hello!
I would like to solve the following linear system:
Ax = b, (where A is symmetric)
but I would like to force the absolute value of x to be 1. That is <x,x>=1
How can I do that?
Thanks a lot, and sorry: I am a newbie in optimization.
"Max Brega" <matped@tiscali.it> wrote in message <hb4r52$5uj$1@fred.mathworks.com>...
> Hello!
> I would like to solve the following linear system:
> Ax = b, (where A is symmetric)
>
> but I would like to force the absolute value of x to be 1. That is <x,x>=1
> How can I do that?
> Thanks a lot, an...

**Solving a recursive system of 3x3 linear systems... #2**Hello, apparently my previous email with the same subject wasn't
readable since it contained a bitmap. Here's the text again with a link
to the bitmap file to be viewed in a browser, hopefully this is better:
Hi everybody,
I'm looking at a recursive system where at each l-th step the three
variables a[i,l] (1 <= i <= 3) have to be solved from a system of three
linear equations involving the previously solved a[i,l+1], ....,
a[i,k] (1 <= i <= 3) (so the iterator l runs back, starting from some
value k). My goal is to find a closed form "direct ...

**solve linear system**Dear all, I'm new to Matlab and so probably my question will be 'stupid' for some of you.
I have an ODE system and I want to find the steady state (i.e. dx/dt=0). I think the way to achieve this task is using the symbolic toolbox and solve, but even with a reduced system, I can't get the solution for one of the variable, why?
>> syms xa xb;
eq1=-ReversibleMichaelis_Menten(xa, xb, p(2), p(3), p(4), p(5))*p(1)+ConstantFlux_irreversible_(p(7))*p(1)
eq2=ReversibleMichaelis_Menten(xa, xb, p(2), p(3), p(4), p(5))*p(1)-ConstantFlux_irreversible_(p(6))*p(1)
[xa xb]=solve(eq1,eq2...

**Linear System solving**I have the system of equations Ax=b.How can I solve it for A if I know the x and b matrices??
And can I use the lscov() function too??
Hi Betty,
How many rows and columns in the x and b matrices?
Thanks.
Rick
"Betty Vag" <betty00arg@hotmail.com> wrote in message
news:ievopg$1l9$1@fred.mathworks.com...
> I have the system of equations Ax=b.How can I solve it for A if I know the
> x and b matrices??
> And can I use the lscov() function too??
>
On Dec 23, 10:10=A0am, "Betty Vag" <betty00...@hotmail.com> wrote:
> I hav...

**solving a linear system**Hi everyone,
I have a linear equation of the form Ax = b which I solve for every
pixel in an input image by the brilliant matlab \ operator.
Right now, I am looping and solving for every pixel. The matrix A does
not change from pixel to pixel. Is there a faster, better way to solve
this rather than a loop through each pixel?
For example, I looked at the LAPACK documentation for functions like
sgels, dgesls etc. and it says the following:
"Several right hand side vectors b and solution vectors x can be
handled in a single call; they are stored as the columns of the
M-by-NRHS right hand...

**linear system linear?**Supposedly simple questions:
Is every "linear system" under all conditions linear? Of course, what is
the precice definition of "linear system"? Is it only the homogenous
solution or homogenous+particulary?
Is a system with nonzero initial conditions linear?
It is a trivial fact that all systems with zero initial conditions are
linear because they can be represented with their transfer functions and
arbitrarily interchanged.
However, consider two systems H1 and H2. Suppose that the initial
conditions for H1=0 and for H2!=0. It makes a difference if I have
...

**complex linear system solving**hi all, i'm an electric ph.doc.ing.
i've to solve a linear system in complex number of several variables.
i've tried to enter in matrix editor complex number like 1+i5 for example,
as well as (1,5) but when i use the command "linsolve" whith these matrix i
can't get to a correct result; i just have wrong number by far, or an
X=symbolic matrix(?!?!?!?). what's wrong?
if i try to use the command "linsolve" and the write the complex matrix
directly(not by"choose" softkey)i have a "bad argument type" error
everytime i try to enter a com...

**solve system of linear equations**Hi I have a system of linear equations(that I've finally vectorized.).I need to solve the following for P but I'm lost as to how to extract P from the vectorized formula to solve. I've put it on 3 lines for readability. Not even sure if I'm providing enough info here?
Any help appreciated!
Thanks
SIRtarget and eta are scalar values
U is an n*1 column
G and X are n*m matrices
P is a row of length m
SIRtarget.*(repmat(U,1,length(G(1,:))).*G)'*(sum(repmat(P,length(X(:,1)),1).*(X./G),2))-SIRtarget.*P'
+SIRtarget*eta*ones(length(G(1,:)),1)
-P'
here is the...

**solving a system of linear equations**Hi,
I have to solve a system of linear equations BUT -
I have more equations than variables.
what is the preferable optimization function to use?
should I look for min ||AX-B||^2?
also - when solving a square matrix, I used fsolve
(got a nice result),
but when I tried the simple A\B I got a warning (bad scaling) and a
poor result. why? How can I improve the matrix?
Thanks.
sounds more like a stats/estimation problem than a matlab problem
Ayelet Dotan wrote:
>
>
> Hi,
> I have to solve a system of linear equations BUT -
> I have more equations than variables.
> what is the...

**solving a system of linear equations**Hi,
In my experiments, I have a system of linear equations in 12
variables. The 12 variables are essentially some context to my new
compression algorithm. I have many such equations.
They are of the form
a1c1 + a2c2 + a3c3 ... + a12c12 = B1
I will typically have 500 of such equations.
My equations will not have an exact solution, but I am trying to find
the closest (best) solution for the variables a1, a2... a12, such that
the B vector is a close approximation of the input.
I am trying to figure out what function in LAPACK I can use to
accomplish this. I beleive dgesv is incorrect sinc...

**solving a linear system of inequalities**Let A=[1 -2 1 3 1;-1 1/2 -3 2 3;1 1 1 -3 -4;1 -3 2 2 4;-3 1 -2 1 2;3 0 -3 1 2]
and b=[0;0;0;0;0]
Ax >= b
How do I solve this in Matlab?
I know how to solve if these are equalities, but not for inequalities.
Thank you so much!
"Loners Hicks" <hick1416@bellsouth.net> wrote in message <hkt395$de5$1@fred.mathworks.com>...
> Let A=[1 -2 1 3 1;-1 1/2 -3 2 3;1 1 1 -3 -4;1 -3 2 2 4;-3 1 -2 1 2;3 0 -3 1 2]
> and b=[0;0;0;0;0]
> Ax >= b
>
> How do I solve this in Matlab?
> I know how to solve if these are equalities, but not for inequalities.
>
>...

**Solving non-linear systems**Sorry to be so lame, but even after reading on-line and Matlab help I can't
figure out how to use lsqnonlin. I've got three equations of the form:
V(q) = q^2 -a1 / exp[a2(q^2 - a3)+1]
And have three solutions at say q1,q2,q3, so three equations with three
unknowns. Should be simple, right?
Thanks,
Rich.
Equal number of equations as unknowns; it looks like you
may want to try FSOLVE instead. To use it you need to
create a function that defines your nonlinear equations;
see the reference page (type "doc fsolve" at the Matlab
prompt, for instance) for an example.
-ma...

**How to solve linear systems efficiently**Hello!
Is there a way to solve the linear system x=-b/A, where A is
a overdetermined, rectangular, complex, double matrix with
~40% zeros, more memory and/or time efficient than mrdivide?
Since I've got 8Gb main memory, the size of the matrix is
limited to below 4Gb, but I'd like to solve the equation for
larger matrixes and, because I've got to solve many
matrixes, I'd like to do it as fast as possible (in case
it's impossible to solve bigger matrixes, it would be also
helpful to solve the <4Gb-matrixes faster).
Thanks,
Jan Paskarbeit
On Mar 3, 9:39=A0am, "Jan...

**Solve a linear system of Equations**Hello,
Everyone. Does Matlab have the ablity to solve a system of 3 equations and 3 unknows? If so what commands should I look for?
Mike
Being that "MATLAB" is short for MATrix LABoratory, one would expect the ability to solve a 3x3 system!
Given Ax = B with unknown x,
x = A\B
Perhaps I should have been more specific.
(granted this is a highly simplifed case).
> known x, y, z,
>
> x = A+2B
y= A+c
z= A+B+C
Can MatLab symbolically solve for A,B,C?
"Michael" <michael.lisowski@gentex.com.extrachar> wrote in message
news:gtep0d$3u2$1@fred.mathwork...

**solve the system of linear equations**I used different iterative method defined as functions in Matlab such as: pcg, cgs, bicg,...
However, non of them gives me a correct solution. I am usually dealing with above 500 equations.
So, any suggestion?
"Hosein" <Kalaeimh@yahoo.com> wrote in message
news:gpc63d$jh3$1@fred.mathworks.com...
>I used different iterative method defined as functions in Matlab such as:
>pcg, cgs, bicg,...
>
> However, non of them gives me a correct solution. I am usually dealing
> with above 500 equations.
> So, any suggestion?
Why can't you set it up as Ax=b and th...

**solving systems of linear equations**Hi folks,
I'm looking for code which solves systems of linear equations for TI's
C67 processors.
I have the "numerical recipes" code but I rather use an optmized code.
Thanks,
Gal
galreuven@gmail.com wrote:
> Hi folks,
> I'm looking for code which solves systems of linear equations for TI's
> C67 processors.
> I have the "numerical recipes" code but I rather use an optmized code.
What is "optimized"??
One thing that I recall from my Matrix Numerical Methods course a while
ago, is that for an arbitrary matrix with no particular struc...

**solving linear equation system**hi
i wanted to solve a linear equation system
it's something like below:
for i=-k:n,
for j=0:m
if i>=0
f1(i,j)p[i][j]=f2(i,j)p[i-1][j]+f3(i,j)p[i+1][j+1]+f4(i,j)p[i][j-1]
else
f'1(i,j)p[i][j]=f2(i,j)p[i-1][j]+f3(i,j)p[i+1][j+1]+f4(i,j)p[i][j-1]
i'm looking forward to your guidance
...

**Solving a linear system with Matlab**Hi everyone,
I have a linear equation of the form Ax = b which I solve for every
pixel in an input image by the brilliant matlab \ operator.
Right now, I am looping and solving for every pixel. The matrix A does
not change from pixel to pixel. Is there a faster, better way to solve
this rather than a loop through each pixel?
Cheers,
Luc
luca.pamparana@gmail.com wrote in message
<856cd3fd-519c-4ca1-9a0f-57e297a00426@y43g2000hsy.googlegroups.com>...
> Hi everyone,
>
> I have a linear equation of the form Ax = b which I solve
for every
> pixel in an input image by the brill...

**Non linear system solving**Dear Group,
I'm a french student working on gears, particulary on gear engagement.
To summerize quickly:
The active surfaces of a gear teeth are made to ensure an homokynetic
(homokinetic) transmission.
We have, in theory,
a1/a2=constant, with ai, the rotation angle of the part i.
My work is to find this relation:
First the surfaces are represented by equations ( a 3D Vector, with two
parameters) in a local coordinate system.
These parameters are u1 and v1 for the gear 1, u2 and v2 for the gear
2.
To simulate the transmission between these gears, we write these
equations in ...

**Non Linear System Solving**Hi Everybody,
I am pretty new with solving non-linear systems of equations in Matlab. Summarizing, I have a 4th order polynomials
Pasc(v) = a1*v + a2*v^2 + a3*v^3 + a4*v^4
and then a set of equations
Pasc(vc)=0;
Pasc(vr)=1;
Pasc(v1)=0.03;
Pasc(v2)=0.4;
Pasc(v3)=0.75;
Pasc(v4)=0.97;
The first two conditions are probably redundant.
How can I perfom the appraisal of coefficients a1,a2,a3,a4 in Matlab making use of standard functions?
I thank you all in advance.
I have implemented this piece of code:
Vin = 4;
Vr = 14;
V1 = Vin + 0.1*(Vr - Vin);
V2 = Vin + 0.5*(Vr - V...