In this example , we want to tell you how to replace specific number of array.
Assume we have follow matrix , and we want replace 0 to -1 ;
In this example , we want to tell you how to replace specific number of array.
Assume we have follow matrix , and we want replace 0 to -1 ;
It is different with the plot function , we can use axis() to adjust the x-axis ,
but it does not work in histogram.
so , Matlab has provided anothoer method as follow:
x = 0:1:4;
y = randn(10000,1);
hist(y,x)
x = 0:1:4 ;
It means that the range of x-asis is from 0 to 4 , and the distance between each column is 1.
The standard form of quadratic programming is 1/2*x'*H*x + f'*x .
In Matlab , we can use the function , quadprog( H,f ) , to solve the quadratic programming problem.
If we want to input data into array in Matlab , we can use the function as below: