<commit_before>---
layout: single
category: command
author_profile: false
excerpt: "Built-in module for sum-of-squares computations"
title: solvesos
tags: [Polynomial programming, Sum-of-squares, Semidefinite relaxations]
comments: true
date: '2016-09-17'
sidebar:
  nav: "commands"
---

[solvesos] computes sum-of-squares decompositions.

### Syntax

````matlab
[sol,u,Q] = solvesos(Constraints,Objective,options,decisionvariables)
````

### Examples
In its most simple form, [solvesos] takes a [sos] constrained polynomial and calculates a sum-of-squares decomposition.

````matlab
x = sdpvar(1,1);
p = x^4+x+5;
F = [sos(p)];
sol = solvesos(F);
if sol.problem == 0
 disp('Sum-of-squares decomposition possible!);<commit_msg>Update 2017-09-17-solvesos.md<commit_after>---
layout: single
category: command
author_profile: false
excerpt: "Built-in module for sum-of-squares computations"
title: solvesos
tags: [Polynomial programming, Sum-of-squares programming, Semidefinite relaxations]
comments: true
date: '2016-09-17'
sidebar:
  nav: "commands"
---

[solvesos] computes sum-of-squares decompositions.

### Syntax

````matlab
[sol,u,Q] = solvesos(Constraints,Objective,options,decisionvariables)
````

### Examples
In its most simple form, [solvesos] takes a [sos] constrained polynomial and calculates a sum-of-squares decomposition.

````matlab
x = sdpvar(1,1);
p = x^4+x+5;
F = [sos(p)];
sol = solvesos(F);
if sol.problem == 0
 disp('Sum-of-squares decomposition possible!);
{'fraction_non_alphanumeric': 0.1472972972972973, 'fraction_numerical': 0.022972972972972974, 'mean_word_length': 5.701357466063349, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4539000', 'n_tokens_mistral': 559, 'n_tokens_neox': 500, 'n_words': 137}