1,341 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

I want to delete all the headerlines and delimiters from the data in the below attached text file

The best solution is probably to read your entire file as text, then remove the header lines, then parse them with textscan.

I want to delete all the headerlines and delimiters from the data in the below attached text file

The best solution is probably to read your entire file as text, then remove the header lines, then parse them with textscan.

2일 ago | 0

Answered

How to do image rotation in matlab?

It is a bit strange to store your image with getappdata on the graphics root, instead of with guidata. You will also notice that...

How to do image rotation in matlab?

It is a bit strange to store your image with getappdata on the graphics root, instead of with guidata. You will also notice that...

3일 ago | 2

| accepted

Answered

How to find the values of jump in an array?

There are several ways to solve this. Below you find a way to look over a few samples where there is a big jump. Another option ...

How to find the values of jump in an array?

There are several ways to solve this. Below you find a way to look over a few samples where there is a big jump. Another option ...

3일 ago | 0

| accepted

Answered

Removing adjacent duplicate numbers in rows of a matrix

You can use diff to find any repeats and remove them. The compare to eps is to avoid strange things happening once you put in de...

Removing adjacent duplicate numbers in rows of a matrix

You can use diff to find any repeats and remove them. The compare to eps is to avoid strange things happening once you put in de...

3일 ago | 1

Answered

How to use slider bars to view images from a dataset?

I didn't implement a case for the 0 position, so I just set the range limits from 1 to 100. %Load an example image a=imread('c...

How to use slider bars to view images from a dataset?

I didn't implement a case for the 0 position, so I just set the range limits from 1 to 100. %Load an example image a=imread('c...

4일 ago | 0

Answered

how to have matlab give feedback if value in a table is outside of a given range

You mean with something like this? x = gallery('integerdata',10,[5,1],2); y = gallery('integerdata',10,[5,1],8); A = table(x,...

how to have matlab give feedback if value in a table is outside of a given range

You mean with something like this? x = gallery('integerdata',10,[5,1],2); y = gallery('integerdata',10,[5,1],8); A = table(x,...

8일 ago | 0

| accepted

Answered

How to fix a program that does not end?

You are increasing your loop variable inside the loop: l=l+1; Is that intentional? What are you trying to achieve there? That ...

How to fix a program that does not end?

You are increasing your loop variable inside the loop: l=l+1; Is that intentional? What are you trying to achieve there? That ...

8일 ago | 0

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...

12일 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...

13일 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...

13일 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.

13일 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...

13일 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...

14일 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...

14일 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...

14일 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 ...

15일 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 ...

18일 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 ...

20일 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.

20일 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...

21일 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). ...

22일 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...

22일 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...

23일 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...

23일 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...

26일 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...

27일 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 ...

29일 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'} ...

29일 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...

29일 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...

29일 ago | 1

| accepted