Also, your algorithm is slightly incorrect. Use something else instead, like macheps. ![]() ![]() You need to check for 1.0 + (macheps/2) in your while loop, not 1.0 + macheps. By creating a variable called eps, you would shadow over the actual function, and so any other functions in MATLAB that require its use will behave unexpectedly, and that's not what you want. x 1.0 × e + a The relative rounding error is: a e + a Because a is very small compared to e: 0.5 × e ( p 1) e 0. By creating a variable called eps, you would shadow over the actual function, and so any other functions in MATLAB that require its use will behave unexpectedly, and that's not what you want. This is a pre-defined function in MATLAB that calculates machine epsilon, which is also what you are trying to calculate. Also, don't use eps as an actual variable. Machine epsilonor machine precisionis an upper bound on the relative approximation errordue to roundingin floating point arithmetic. ![]() What adjusts how strong the relationship is and what the direction of this relationship is between the inputs and outputs are. The higher the inputs are, the higher (or lower, if the relationship was negative) the outputs are. First and foremost, there is no such thing as a do keyword in MATLAB, so eliminate that from your code. Taken together, a linear regression creates a model that assumes a linear relationship between the inputs and outputs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |