Why does the code always return “-ve” values?
When I run the main, it returns me all negative values though I have given only two negative values.
Explanaton: Inside main, I have provided only two negative values in vector u. But when I run it, it gives me either all negative values or three of them as negative values though the magnitudes are nearly the same but the signs are negative. Where does this negative sign come from?
All the three codes are attached. Just run main and see the result in the command window. The values of vector u are returned back in a variable best.When I run the main, it returns me all negative values though I have given only two negative values.
Explanaton: Inside main, I have provided only two negative values in vector u. But when I run it, it gives me either all negative values or three of them as negative values though the magnitudes are nearly the same but the signs are negative. Where does this negative sign come from?
All the three codes are attached. Just run main and see the result in the command window. The values of vector u are returned back in a variable best. When I run the main, it returns me all negative values though I have given only two negative values.
Explanaton: Inside main, I have provided only two negative values in vector u. But when I run it, it gives me either all negative values or three of them as negative values though the magnitudes are nearly the same but the signs are negative. Where does this negative sign come from?
All the three codes are attached. Just run main and see the result in the command window. The values of vector u are returned back in a variable best. all negative values, three of them negative, from where does -ve sign come, how to overcome it MATLAB Answers — New Questions