The food pellets also have color additives that help give the farm raised salmon the nice pinkish color weâre all accustomed to. Otherwise, theyâd be a dullish grey color*. *Wild salmon, by contrast, obtain their pink hue from their natural environment by feasting on a diet of krill, which eats red algae. 7.
Generate random numbers with a given distribution. The rand function in MATLAB returns uniformly distributed pseudorandom values from the open interval (0, 1), but we often need random numbers of other kind of distributions. A great article written by John S. Denker explains a method of generating random numbers with arbitrary distribution.
6. Now set up your graph. 1  Simple and Vector Methods: Type plot(x) after your for loop if you used the vector method. 2  If you used the simple method, type plot(x,y) and hit enter, then skip to step 8. 3  The general form of the plot function is plot(x,y) where x and y are lists of numbers. Simple Method. 2  Vector Method: Set up a for loop to place values into a vector. 3  Vector assignments in MATLAB follow the form x(i) = 2, where âiâ is any number greater than, but not including, zero. 4  You can also reference parts of the vector that already have a value, like x(3) = x(2) + x(1).