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

How to find the row numbers of similar elements

Assuming you want a matrix with the duplicate row indices, the code below should work. It pads the columns with NaN. I slightly ...

How to find the row numbers of similar elements

Assuming you want a matrix with the duplicate row indices, the code below should work. It pads the columns with NaN. I slightly ...

4 hours ago | 0

Answered

How to split numeric values and store them?

The code below should do the trick. You will also notice there are much more comments explaining what the code is attempting to ...

How to split numeric values and store them?

The code below should do the trick. You will also notice there are much more comments explaining what the code is attempting to ...

5 hours ago | 0

Answered

App designer big projects

One possible solution involves two steps: Load the dictionary Reset the texts that are visible with the updated dictionary Yo...

App designer big projects

One possible solution involves two steps: Load the dictionary Reset the texts that are visible with the updated dictionary Yo...

5 days ago | 1

| accepted

Answered

Distance between all points in array and delete the second point if it is less that certian value (Victorized)

After a few runs I think this would be equivalent to your loop version. Note that it generates a matrix of size [n n 3] in one o...

Distance between all points in array and delete the second point if it is less that certian value (Victorized)

After a few runs I think this would be equivalent to your loop version. Note that it generates a matrix of size [n n 3] in one o...

6 days ago | 1

| accepted

Answered

Rolling all six numbers on a six sided die

At first I mis-interpreted the question, so that may have caused some confusion. What you can do is create a logical vector wit...

Rolling all six numbers on a six sided die

At first I mis-interpreted the question, so that may have caused some confusion. What you can do is create a logical vector wit...

6 days ago | 1

Answered

Sharing information between Callback functions in GUIDE

Because hObject is the handle to your pushbutton, you need to explicitly say you want to get the content of the edit box: z...

Sharing information between Callback functions in GUIDE

Because hObject is the handle to your pushbutton, you need to explicitly say you want to get the content of the edit box: z...

6 days ago | 0

Answered

Read .txt and Write in matab

I suspect this is what you need: C=readfile('output.txt');%read the file to a cell array Ca=C(2618:3484);%select the lines ...

Read .txt and Write in matab

I suspect this is what you need: C=readfile('output.txt');%read the file to a cell array Ca=C(2618:3484);%select the lines ...

7 days ago | 0

| accepted

Answered

How to create the combination of zeros and ones matrix in matlab?

Although I have the feeling this might be homework, I'm going to give a complete answer anyway. By a happy coincidence, this cod...

How to create the combination of zeros and ones matrix in matlab?

Although I have the feeling this might be homework, I'm going to give a complete answer anyway. By a happy coincidence, this cod...

7 days ago | 0

| accepted

Answered

No jump in in if-query even though if-statement is true

Not all decimal numbers can be stored in binary as an exact value. This float rounding error can lead to situations like this. Y...

No jump in in if-query even though if-statement is true

Not all decimal numbers can be stored in binary as an exact value. This float rounding error can lead to situations like this. Y...

7 days ago | 0

| accepted

Answered

fprintf help wont show full statement

Simply pasting what you posted into my copy of Matlab gives a hint about the cause: I get a warning from m-lint (the orange squ...

fprintf help wont show full statement

Simply pasting what you posted into my copy of Matlab gives a hint about the cause: I get a warning from m-lint (the orange squ...

19 days ago | 2

Answered

How to open several GUIs one at a time in a matlab script?

As long as your GUI functions return a handle to the figure, you can use the <https://www.mathworks.com/help/matlab/ref/uiwait.h...

How to open several GUIs one at a time in a matlab script?

As long as your GUI functions return a handle to the figure, you can use the <https://www.mathworks.com/help/matlab/ref/uiwait.h...

19 days ago | 0

| accepted

Answered

How can I search a cell array for all instances of a character and replace it with something else?

From your description, I suspect the simple fact that it is an asterisk doesn't actually matter. The code below will find all ce...

How can I search a cell array for all instances of a character and replace it with something else?

From your description, I suspect the simple fact that it is an asterisk doesn't actually matter. The code below will find all ce...

21 days ago | 0

Answered

Creating a function to return a string into upper and lower case

Matlab did exactly what you asked: you wrote a function with an input, but without an output. I you open this in the Matlab edit...

Creating a function to return a string into upper and lower case

Matlab did exactly what you asked: you wrote a function with an input, but without an output. I you open this in the Matlab edit...

21 days ago | 1

| accepted

Answered

Can't connect all the dots with a line

Store the ratio in an array: %rest of your code ratio=zeros(size(b)); for i=length(b) %rest of your code ratio(i) =...

Can't connect all the dots with a line

Store the ratio in an array: %rest of your code ratio=zeros(size(b)); for i=length(b) %rest of your code ratio(i) =...

21 days ago | 0

| accepted

Answered

plotting the points near to origin

Your data doesn't seem to fit your plots. The code below should give you an idea of how you could do this. You could also define...

plotting the points near to origin

Your data doesn't seem to fit your plots. The code below should give you an idea of how you could do this. You could also define...

21 days ago | 0

| accepted

Answered

how do I find the index of all values which meet a condition within an array ?

With the find function you can look up the linear indices of all non-zero elements in an array. (you can also look up row and co...

how do I find the index of all values which meet a condition within an array ?

With the find function you can look up the linear indices of all non-zero elements in an array. (you can also look up row and co...

22 days ago | 0

| accepted

Answered

How to store an image into cell arrays in a loop?

You forgot to call your function: %% Part 3 %Write function %Iterate Gaussian filtering and then subsampling 5 times for Gaus...

How to store an image into cell arrays in a loop?

You forgot to call your function: %% Part 3 %Write function %Iterate Gaussian filtering and then subsampling 5 times for Gaus...

23 days ago | 1

Answered

Daily 3d array to monthly- dealing with alternate days in a month and leap years - How to do it?

You don't have another option than just hardcoding the number of days in a month. You can do this in a fancy way using the date ...

Daily 3d array to monthly- dealing with alternate days in a month and leap years - How to do it?

You don't have another option than just hardcoding the number of days in a month. You can do this in a fancy way using the date ...

24 days ago | 1

| accepted

Answered

i split the image pixels into many small matrices

The blockproc function works on distinct blocks. If you want a sliding window operation you need to use a function like nlfilter...

i split the image pixels into many small matrices

The blockproc function works on distinct blocks. If you want a sliding window operation you need to use a function like nlfilter...

27 days ago | 0

| accepted

Answered

calculating percentage change function

You should use = for an assignment and == for a comparison. Another point is that you don't need a conditional for an else, only...

calculating percentage change function

You should use = for an assignment and == for a comparison. Another point is that you don't need a conditional for an else, only...

28 days ago | 0

Answered

Manage and produce subplots

It is not too dificult to keep track of you p in a loop: p=0; for n=1:9 p=p+1;%(p=n; would also work for this example) ...

Manage and produce subplots

It is not too dificult to keep track of you p in a loop: p=0; for n=1:9 p=p+1;%(p=n; would also work for this example) ...

28 days ago | 1

Answered

concat images in order

folder= '/home/user/PycharmProjects/2.5dataconversion/images/patient_1' dest = '/home/user/PycharmProjects/2.5dataconversion/im...

concat images in order

folder= '/home/user/PycharmProjects/2.5dataconversion/images/patient_1' dest = '/home/user/PycharmProjects/2.5dataconversion/im...

29 days ago | 0

Answered

I'm trying to write a program that types out a line with n integers starting with n0 , separated by commas and spaces. It needs to use a forloop and should turn out like this n=10 n0=5 --> 5, 6, 7, 8, 9, 10, 11, 12, 13, 14. This is what I have so far

Since this is a homework assignment, I will leave some blanks for you to fill in. n=10;n0=5; clc%clear command window for k...

I'm trying to write a program that types out a line with n integers starting with n0 , separated by commas and spaces. It needs to use a forloop and should turn out like this n=10 n0=5 --> 5, 6, 7, 8, 9, 10, 11, 12, 13, 14. This is what I have so far

Since this is a homework assignment, I will leave some blanks for you to fill in. n=10;n0=5; clc%clear command window for k...

30 days ago | 1

| accepted

Answered

Parallel for loop in loading files

Removing clear all from your code and loading to a struct (instead of poofing variables into existence) should allow you to repl...

Parallel for loop in loading files

Removing clear all from your code and loading to a struct (instead of poofing variables into existence) should allow you to repl...

1 month ago | 0

Answered

Distance between ALL(all combinations) points of matrix

Note that you are not calculating only unique combinations. The reason you are only getting a single value is that you are not i...

Distance between ALL(all combinations) points of matrix

Note that you are not calculating only unique combinations. The reason you are only getting a single value is that you are not i...

1 month ago | 0

| accepted

Answered

how to convert a 3-d binary array of spherical cordinates into floating type array of cartesian cordinates

If you get my findND function from the FEX you can do this: %find 3D indices in M [r,c,p]=findND(M); %create lookup tables ...

how to convert a 3-d binary array of spherical cordinates into floating type array of cartesian cordinates

If you get my findND function from the FEX you can do this: %find 3D indices in M [r,c,p]=findND(M); %create lookup tables ...

1 month ago | 0

| accepted

Answered

b=abs([b;a(i)-a(i+1)]); error

Your loop goes up to 27, and inside the loop you look at i+1. You should let your loop go to |numel(a)-1| instead of 27.

b=abs([b;a(i)-a(i+1)]); error

Your loop goes up to 27, and inside the loop you look at i+1. You should let your loop go to |numel(a)-1| instead of 27.

1 month ago | 0

Answered

Why is matlab giving me a a very small number when the answer should be EXACTLY zero?

Because not all numbers can be stored as an exact binary number, some calculations will have rounding errors. %exagerated examp...

Why is matlab giving me a a very small number when the answer should be EXACTLY zero?

Because not all numbers can be stored as an exact binary number, some calculations will have rounding errors. %exagerated examp...

1 month ago | 1

Answered

Find and count how many capital characters are in str, and then change them to lower cases USING LOOPS

You can easily do this without loops: s = 'This is my String with CapiTal LETTERS in it. Let''s change them to lowercase uSiNg ...

Find and count how many capital characters are in str, and then change them to lower cases USING LOOPS

You can easily do this without loops: s = 'This is my String with CapiTal LETTERS in it. Let''s change them to lowercase uSiNg ...

1 month ago | 0

Answered

blockproc applied to ROI images

Using a nested function will allow you to share variables without having to resort to evalin. As for your actual problem: you co...

blockproc applied to ROI images

Using a nested function will allow you to share variables without having to resort to evalin. As for your actual problem: you co...

1 month ago | 0