create a vector with different values and extract the highest values in matlab
To create a vector with different values, you can use the following code:
main.m
```
v = [105201525];
```
To extract the highest value in the vector, you can use the maxfunctioninMATLAB:
```
max_value = max(v);
```
To extract the n number of highest values, you can use the sortfunctionandselectthetopnvalues:
```
sorted_v = sort(v, 'descend');
n = 3;
top_n_values = sorted_v(1:n);
```
The `sort` functionsortstheelementsofthevectorvindescendingorderandstorestheresultinthe `sorted_v` vector. Then, thetop `n` valuesareselectedbyindexingintothe `sorted_v` vectorusingthecolonoperator. Ifyouwanttooutputtheindicesofthesetop `n` valuesratherthanthevaluesthemselves, youcanusethe `maxk` function:
```
[top_n_values, indices] = maxk(v, n);
```