Answered

Count if a vector has at list one element greater than zero

count = sum(v>0) The expression v>0 creates a logical array of 1s and 0s, with a 1 for every element of v that is greater than ...

Count if a vector has at list one element greater than zero

count = sum(v>0) The expression v>0 creates a logical array of 1s and 0s, with a 1 for every element of v that is greater than ...

más de 1 año ago | 0

| accepted

Answered

Equation in a single column matrix?

When I run your code (after fixing a typo when you refer to what I think should be b(n)/13), the result is a 1-by-6 array for c:...

Equation in a single column matrix?

When I run your code (after fixing a typo when you refer to what I think should be b(n)/13), the result is a 1-by-6 array for c:...

más de 1 año ago | 1

| accepted

Answered

evaluation of anonymous function

I am not quite sure if this is what you are asking, but I'll give it a shot: The piece of code important to your question is r...

evaluation of anonymous function

I am not quite sure if this is what you are asking, but I'll give it a shot: The piece of code important to your question is r...

más de 1 año ago | 1

Answered

Adding a pathdef.m file, as a string, to the current path

You probably want to use textscan for this: fileID = fopen('pathdef_etc.m') C = textscan(fileID, '%s', 'Delimiter', '\n') fcl...

Adding a pathdef.m file, as a string, to the current path

You probably want to use textscan for this: fileID = fopen('pathdef_etc.m') C = textscan(fileID, '%s', 'Delimiter', '\n') fcl...

más de 1 año ago | 1

| accepted

Answered

how to define a gradient colormap

Yes, you can use a fixed colormap by executing the following command each time you plot an image: caxis([-1 1]) This will map ...

how to define a gradient colormap

Yes, you can use a fixed colormap by executing the following command each time you plot an image: caxis([-1 1]) This will map ...

más de 1 año ago | 1

| accepted

Answered

Index a cell array with an cell

Hi Christian, You can pick the corresponding entries for each of the cells of C as follows: C{i}(B{i}==0) The results are the...

Index a cell array with an cell

Hi Christian, You can pick the corresponding entries for each of the cells of C as follows: C{i}(B{i}==0) The results are the...

más de 1 año ago | 0

Solved

Find the sum of all the numbers of the input vector

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

más de 1 año ago

Answered

Delete values in a table but keep the cells

Try df{r,c} = {''} instead. You should be able to avoid the inner loop entirely by using df{r,3:nCols} = {''} Also, to check...

Delete values in a table but keep the cells

Try df{r,c} = {''} instead. You should be able to avoid the inner loop entirely by using df{r,3:nCols} = {''} Also, to check...

más de 1 año ago | 0

| accepted

Answered

Specify annotation position with respect to x- and y-axes values?

This is an older post, but the following is perhaps useful to others: If horizontal arrows are ok, data units can be used by as...

Specify annotation position with respect to x- and y-axes values?

This is an older post, but the following is perhaps useful to others: If horizontal arrows are ok, data units can be used by as...

más de 1 año ago | 13

Answered

check if figure exists whithout making it appear and using its figure number in findobj()

R2014b and later no longer use numeric handles for graphics objects, so most answers given above do not work. In these cases, ...

check if figure exists whithout making it appear and using its figure number in findobj()

R2014b and later no longer use numeric handles for graphics objects, so most answers given above do not work. In these cases, ...

casi 7 años ago | 1