## How to solve linear least squares problem of the following form in matlab

### Y I (view profile)

on 3 Dec 2018 at 23:35
Latest activity Commented on by Walter Roberson

### Walter Roberson (view profile)

on 8 Dec 2018 at 23:14

### Walter Roberson (view profile)

Hello
1. I need to solve the problem which is written in the following form:
I have all the terms except ws, which I need to find. Firstly I don't understand how I can rewrite this problem in the following way Ws = ... Is it possible?
And how to solve this problem in Matlab? I did not find suitable function which corresponds to this form...
2. From the same article:
I don't have any idea how they rewrite this but how to solve this problem in this form?
What I found in Matlab is:
But what does it mean this 2 at the bottom and can I use this function to solve equation (3)?
Since H and h are the matrices, so can I write in matlab vector A which contains another matrices?
Thank you!

### Walter Roberson (view profile)

on 4 Dec 2018 at 0:29

||expression|| with subscript 2 means the 2-norm, also known as the Euclidean distance. With the Euclidean distance being sqrt() of a sum of squares, and with the result of the 2-norm being squared by lsqnonneg, what is being computed is effectively the sum of squares.
Likely this is the same thing that your equation means with ||expression|| squared with no subscript 2, so Yes, lsqnonneg is a plausible function.

Walter Roberson

### Walter Roberson (view profile)

on 8 Dec 2018 at 23:05
Are your ws permitted to be complex valued? Are they permitted to be negative?
Y I

### Y I (view profile)

on 8 Dec 2018 at 23:11
Yes, ws are permitted to be complex and negative.
Walter Roberson

### Walter Roberson (view profile)

on 8 Dec 2018 at 23:14
Then Yes, it looks to me as of you can use the \ operator.
MATLAB offers multiple methods of solving problems.