About 24,800,000 results
Open links in new tab
  1. How to convert all array values into negative ones? - MATLAB

    Jan 31, 2022 · I have an array A: A = [2; 3; 5; -8; 9; 1; -1] how do I convert it into an array whose values are all negative? So as to obtain B: A = [-2; -3; -5; -8; -9; -1; -1] Thanks!

  2. Negative indexing of an array - MATLAB Answers - MATLAB

    Sep 10, 2020 · There is no non-positive indexing in Matlab. you can use x (end) for the last member, x (end-1) the member before the last member and so on. Sign in to comment. This does appear to use the same "x" on the left side and the right side, but it does not really do so.

  3. How to replace negative elements in a Matrix with zeros? - MATLAB

    Jan 17, 2018 · Now I am trying to set up a nested for loop to redefine negative elements in A. I need to replace negative elements in A with a zero. How do I go about doing this?

  4. Matlab - replacing all negative and positive values

    Apr 19, 2013 · If I have an array of positive and negative values, how do I only keep the positive ones, and replace the negative ones by 0?

  5. How to change the values of an Matrix (or array) to 1 & 0 for ... - YouTube

    How to change the values of an Matrix (or array) to 1 & 0 for positive & negative values in MATLAB? - YouTube. In this video it shows the code to change the values in a matrix to 1 and 0....

  6. MATLAB - replace zeros in matrix with small number

    Jun 5, 2013 · Is there a way to quickly replace zero elements in a matrix with a input of my choice. Quickly - meaning, without a loop. The direct answer is: which does exactly what you ask for, replacing zeros with a small number. See that this does an implicit search for the zeros in a vectorized way. No loops are required.

  7. How to make all negative values in a matrix 0? - MATLAB

    Nov 18, 2020 · To set set negative values in a certain column of matrix "A" to 0, you can do this: For this example we assume A is a 2-D number matrix and that we are getting rid of negative values in the 2nd column.

  8. MATLAB - How to plot a function using an array with negative

    Nov 11, 2017 · Since you can't access array elements with negative indices, you'll need to use a different variable than i to keep track of each element in x and y; this new variable should start at 1 and increment with every loop iteration.

  9. How to convert all array values into negative ones? - MATLAB

    Jan 31, 2022 · I have an array A: A = [2; 3; 5; -8; 9; 1; -1] how do I convert it into an array whose values are all negative? So as to obtain B: A = [-2; -3; -5; -8; -9; -1; -1] Thanks!

  10. Detect where an array becomes negative - MATLAB Answers

    I have an array of size 401 x 381 which has positive and negative values. I would like to detect which row in each column this change of sign occurs for the purposes of comparison. If anyone has any ideas they will be appreciated.

  11. Some results have been removed