1,334 total contributions since 2017

E-mails with feedback/questions about FEX submissions are welcomed. In general I will post e-mails about Answers on the related page, unless there is good cause not to do so.

Answered

If else problem for year

You can do this two ways: Option 1 is to do the actual work. Is the input correct? Does the month entered actually have at leas...

If else problem for year

You can do this two ways: Option 1 is to do the actual work. Is the input correct? Does the month entered actually have at leas...

4 days ago | 0

Answered

Select 100 points either side from mouse click cooradinates

Use the x-coordinate returned by getpts to select the data. x=linspace(0,10,1000); %generate a smooth random curve y=sin(x)+p...

Select 100 points either side from mouse click cooradinates

Use the x-coordinate returned by getpts to select the data. x=linspace(0,10,1000); %generate a smooth random curve y=sin(x)+p...

5 days ago | 0

Answered

Problem in coordinate conversion

This behavior is as documented. The result is in the [-pi pi] radians range. If you want to have your angles in the range [0 360...

Problem in coordinate conversion

This behavior is as documented. The result is in the [-pi pi] radians range. If you want to have your angles in the range [0 360...

5 days ago | 0

Answered

There is a mistake with such expressions as mod(23^12,24). MATLAB gives an answer of 0 which, given that 23 and 24 are relative primes,

The number you're trying to process is larger than flintmax(), so you can rely on single digit precision operations.

There is a mistake with such expressions as mod(23^12,24). MATLAB gives an answer of 0 which, given that 23 and 24 are relative primes,

The number you're trying to process is larger than flintmax(), so you can rely on single digit precision operations.

5 days ago | 0

Answered

Is there an equivalent function in Matlab 2019 to the earlier version's isunicode function?

The isunicode function may look promissing, but doesn't actually work on my test files (generated with Notepad++). The same prob...

Is there an equivalent function in Matlab 2019 to the earlier version's isunicode function?

The isunicode function may look promissing, but doesn't actually work on my test files (generated with Notepad++). The same prob...

5 days ago | 0

Answered

How replace matching string

Because your second and third condition can be merged, you can use ismember: data={'Pass','Pass{overflow :1,unbound:5,warning:9...

How replace matching string

Because your second and third condition can be merged, you can use ismember: data={'Pass','Pass{overflow :1,unbound:5,warning:9...

5 days ago | 0

Answered

Convolution of absolute magnitude =/= absolute magnitude of convolution?

Let's consider a minimal example: data=[-3 0 3]; kernel=[1 1 1]/3; Now it is easy to see that convolving first and then takin...

Convolution of absolute magnitude =/= absolute magnitude of convolution?

Let's consider a minimal example: data=[-3 0 3]; kernel=[1 1 1]/3; Now it is easy to see that convolving first and then takin...

6 days ago | 0

| accepted

Answered

Creating a for loop to see if date exists

If you insist or keeping it as a double, you can use ismember three times, but it makes more sense to make use of the datetime c...

Creating a for loop to see if date exists

If you insist or keeping it as a double, you can use ismember three times, but it makes more sense to make use of the datetime c...

6 days ago | 0

| accepted

Answered

Variable is in a function file, how do I use a loop to change the value of this variable?

According to the doc you can pass extra parameters by setting an anonymous function. I see no indication in the R2014a doc that ...

Variable is in a function file, how do I use a loop to change the value of this variable?

According to the doc you can pass extra parameters by setting an anonymous function. I see no indication in the R2014a doc that ...

7 days ago | 0

Answered

Title for a figure containing many pictures

You can also use the suptitle function. I remember it as being a native Matlab function, but I couldn't find it in the doc. You ...

Title for a figure containing many pictures

You can also use the suptitle function. I remember it as being a native Matlab function, but I couldn't find it in the doc. You ...

10 days ago | 0

Answered

hi every one , how can i do a for cycle with diffrent vector length , thank you

You can put them in a cell array and let cell2mat handle the removal of empty elements. I have no clue what you want to do with ...

hi every one , how can i do a for cycle with diffrent vector length , thank you

You can put them in a cell array and let cell2mat handle the removal of empty elements. I have no clue what you want to do with ...

12 days ago | 0

| accepted

Answered

Name variables according to string

Why not store them in a struct array? If all mat files have the same fields that should work very well.

Name variables according to string

Why not store them in a struct array? If all mat files have the same fields that should work very well.

12 days ago | 0

| accepted

Answered

could anyone help me to solve the issue

This removes elements until your matrix is no longer valid according to your rule. It is very slow for bigger matrices, but it i...

could anyone help me to solve the issue

This removes elements until your matrix is no longer valid according to your rule. It is very slow for bigger matrices, but it i...

12 days ago | 0

| accepted

Answered

How to take R-Square value as a variable

If you mean you want to access the value of the rsquare field, you can do that as with any struct (see the line of code below). ...

How to take R-Square value as a variable

If you mean you want to access the value of the rsquare field, you can do that as with any struct (see the line of code below). ...

14 days ago | 0

| accepted

Answered

matlab piece wise function

That is a good idea of solving your problem. There is one thing you're forgetting in your logic: to trim the parts you don't nee...

matlab piece wise function

That is a good idea of solving your problem. There is one thing you're forgetting in your logic: to trim the parts you don't nee...

14 days ago | 0

Answered

where can i download MATLAB for windows 7 32bits?

You'll have to choose R2015b or earlier. That is the latest version where there is a 32 bit version. If you need a newer version...

where can i download MATLAB for windows 7 32bits?

You'll have to choose R2015b or earlier. That is the latest version where there is a 32 bit version. If you need a newer version...

15 days ago | 1

Answered

Remove rows based on length of column value

Instead of implicit expansion (which can take a lot of memory for bigger arrays), you can use histogram counts: S=load('practic...

Remove rows based on length of column value

Instead of implicit expansion (which can take a lot of memory for bigger arrays), you can use histogram counts: S=load('practic...

15 days ago | 0

| accepted

Answered

Can anyone help me with the error?

You aren't plotting a function, but a vector. Replace fplot by plot, or replace your input by a function. Actually, doing both w...

Can anyone help me with the error?

You aren't plotting a function, but a vector. Replace fplot by plot, or replace your input by a function. Actually, doing both w...

17 days ago | 1

| accepted

Answered

How to calculate accuracy from confusion matrix?

Accuracy = (TP+TN)/(TP+TN+FP+FN) where: TP = True positive; FP = False positive; TN = True negative; FN = False negative A...

How to calculate accuracy from confusion matrix?

Accuracy = (TP+TN)/(TP+TN+FP+FN) where: TP = True positive; FP = False positive; TN = True negative; FN = False negative A...

18 days ago | 0

Answered

Could anyone help me how to solve the following issue.

I can't think of a better solution, but you could try brute-forcing it with a while loop: maxval=5;cols=10; if maxval>cols ...

Could anyone help me how to solve the following issue.

I can't think of a better solution, but you could try brute-forcing it with a while loop: maxval=5;cols=10; if maxval>cols ...

21 days ago | 0

| accepted

Answered

extracting data from hex

You should only remove the leading 0x as that indicates the data is hexadecimal. data_hex={{'0x0000D830'} {'0x000103EA'} ...

extracting data from hex

You should only remove the leading 0x as that indicates the data is hexadecimal. data_hex={{'0x0000D830'} {'0x000103EA'} ...

21 days ago | 0

Answered

customised x data in matlab plot

The XTick property requires a vector with numeric data, but the XTickLabel property requires a cell array. labels = [0 2000 400...

customised x data in matlab plot

The XTick property requires a vector with numeric data, but the XTickLabel property requires a cell array. labels = [0 2000 400...

21 days ago | 0

| accepted

Answered

How to create a function which accepts a name of a mat-file and returns a structure array with fields’ Name and Size?

Lets go through your proposed code: function se=se(name)%don't give your ouput the same name to your output as your function f...

How to create a function which accepts a name of a mat-file and returns a structure array with fields’ Name and Size?

Lets go through your proposed code: function se=se(name)%don't give your ouput the same name to your output as your function f...

21 days ago | 1

| accepted

Answered

How can I append same size matrix vertically?

Nothing here is happening automatically. With the comma you are telling Matlab that you want to concatenate horizontally. If you...

How can I append same size matrix vertically?

Nothing here is happening automatically. With the comma you are telling Matlab that you want to concatenate horizontally. If you...

21 days ago | 1

Answered

How to find the indices of a data column that aren't Nan, and how to use those indices to concatenate a vector?

The not function (or simply ~) doesn't have a second output. Luckily you don't need it. You can directly use its output to perfo...

How to find the indices of a data column that aren't Nan, and how to use those indices to concatenate a vector?

The not function (or simply ~) doesn't have a second output. Luckily you don't need it. You can directly use its output to perfo...

21 days ago | 0

| accepted

Answered

How to read images from one directory into variables using loop?

You don't want numbered variables. Try a cell array instead. That way you can much more easily loop through your images to do th...

How to read images from one directory into variables using loop?

You don't want numbered variables. Try a cell array instead. That way you can much more easily loop through your images to do th...

21 days ago | 0

Answered

Do I need to reference matlab in an academic paper?

That depends a bit on the context and the journal. You can ask your supervisor what they think. Personally I also do some parts ...

Do I need to reference matlab in an academic paper?

That depends a bit on the context and the journal. You can ask your supervisor what they think. Personally I also do some parts ...

21 days ago | 0

Answered

how to get image from specific folder and resize each image and save them is a new folder

This is how you can provide the full path to imread: for K = 1 : length(dinfo) thisimage = dinfo(K).name; Img = imread(...

how to get image from specific folder and resize each image and save them is a new folder

This is how you can provide the full path to imread: for K = 1 : length(dinfo) thisimage = dinfo(K).name; Img = imread(...

22 days ago | 0

Answered

How do I sort filenames base on the numbers right before file name in MATLAB?

This should to the trick. Note that this will return an error if there is no match. names={'example_1.mat','example_15.mat','ex...

How do I sort filenames base on the numbers right before file name in MATLAB?

This should to the trick. Note that this will return an error if there is no match. names={'example_1.mat','example_15.mat','ex...

22 days ago | 0

| accepted

Answered

Using vectorization on a problem to reduce For loops, how to use conditional statement?

You can find an explanation of logical indexing on that page you linked. The most important thing if you want to vectorize an o...

Using vectorization on a problem to reduce For loops, how to use conditional statement?

You can find an explanation of logical indexing on that page you linked. The most important thing if you want to vectorize an o...

22 days ago | 1