Community Profile

photo

Rik


Last seen: Today
2,224 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.

Contact

Rik's Badges

  • MATLAB Central Treasure Hunt Finisher
  • 36 Month Streak
  • GitHub Submissions Level 3
  • Ace
  • Personal Best Downloads Level 3
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 4
  • First Submission
  • Revival Level 3
  • Thankful Level 2
  • Knowledgeable Level 4
  • First Answer
  • Solver

View details...

Contributions in
View by

Answered
Old MATLAB Online Courses
The basics haven't changed (much) since then. For an incomplete overview, see this thread. You can also do the Onramp tutorial ...

2 days ago | 0

| accepted

Answered
Data fitting by non linear discrete equation.
The code below uses fminsearch, which means you don't need the optimization toolbox. The downside is that it is sensitive to a l...

3 days ago | 0

| accepted

Answered
Output only numbers with complex conjugate
a = [1+1i*0.1, 1-1i*0.1, 5-1i*0.1, 10+1i*0.2, 10-1i*0.2]; b=conj(a); c=b(ismember(b,a)); d=real(c)+1i*abs(imag(c)); e=unique...

3 days ago | 1

Answered
How to make a loop of a calculator that keeps asking until the input is zero/nothing?
You forgot to convert the result to a number, so it is a char array. %radian = input ('Input a number: ', 's'); %Input a numbe...

3 days ago | 1

| accepted

Answered
From for to While loop
Your original for-loop probably was incorrect. And why do you want a while loop? You already know how many iterations you want. ...

3 days ago | 0

| accepted

Answered
Possible combinations for a vector
s=[0,0,0,0,0,0,0,0,0]; max_value_of_s=2; num_combinations=(max_value_of_s+1)^numel(s); disp(num_combinations) That is going ...

3 days ago | 1

Answered
How do you circshift progressive rows an increasing amount?
You need to index a column in A in your output as well. for K = 1:size(A,2) A(:,K) = circshift(A(:,K),K); end If you want...

4 days ago | 0

| accepted

Answered
How do I overwrite a structure using a switch statement.
You can copy the code I used in my FEX submissions (see WBM, readfile, BlandAltmanPlot or RegGrow). If you simply want to ove...

4 days ago | 0

Answered
Keep getting an error as 'ASCII file unsupported' which terminates the code
The solution is in the error message: "Saving sparse arrays to an ASCII file is unsupported." Either use full to convert your s...

4 days ago | 0

| accepted

Answered
Selecting parts of HTML file
First read the html files (you can get my readfile function from the FEX. If you are using R2017a or later, you can also get it ...

4 days ago | 0

| accepted

Answered
How to eliminate standalone 1 or 0 in binary matrix
I would suggest using a convolution with a flat kernel. kernel=ones(1,3,1);kernel=kernel/sum(kernel(:)); A=[0 0 1 1 1 0 1 1 0 ...

4 days ago | 1

| accepted

Answered
how to extract a specific text/string from text file
You can either use my readfile function (which you can get from the file exchange or the add-on manager). Another option is to u...

6 days ago | 1

Answered
Count the number of times a sequence in a matrix repeats
Both the unique and ismember functions can handle rows. Look at the respective documentation pages for details.

6 days ago | 0

Answered
Split RGB Image into blocks (24-bit)
The better solution would be to use blockproc, but you can also use mat2cell and use a loop.

6 days ago | 0

Answered
How to perform circshift on specific elements?
You are overwriting the original array, instead of using circshift on the partial array. A = [1 2 3 4; 5 6 7 8; 9 10 11 12]; L...

7 days ago | 0

| accepted

Answered
displaying the total number of times an if statement is true
You can use the fact that sum will functionally cast your logical array to 0 and 1: grains=sum(xc_array(:,1)>0.188); fprintf('...

7 days ago | 0

| accepted

Answered
loop iteration in matlab
I would suggest not using a loop: F=@(x) sum( ( (1:x).^5 ).*(x:-1:1) );

7 days ago | 0

Answered
Removing white background from Barcode image(s)
The easiest solution is to not add the border in the first place: barWidth = 3;barHeight = 100;appendTerminationMarkers = false...

7 days ago | 1

| accepted

Answered
turn a vector into a scalar
I guess boldly: g=sym('0.1178542134') g_=double(g) %convert the scalar sym to a scalar double

8 days ago | 1

Answered
Thresholding a value in matrix
You can use the comparator operators to apply a threshold: data=randi(200,8,8); L= data<100; %L is true for all positions with...

8 days ago | 0

| accepted

Answered
How to colorize a range of pixel values in a grayscale image?
You can either adjust the colormap, or use imshow. If your image is not uint8, you will have to scale it down to [0,1] to make s...

8 days ago | 0

Answered
product selection for a mechanical engineer
If you have disk space to spare you can install all toolboxes that are available to you. Another strategy would be to only inst...

9 days ago | 1

Answered
How to remove file extension when using ugetfile in app designer?
The easiest way to remove an extension is with fileparts: [p,f,e]=fileparts(fullfilename); fullfilename=fullfile(p,f);

9 days ago | 1

| accepted

Answered
How to insert numbers into a empty vector in a loop
You should not put it in an empty vector. You should put the results in an array: [m,s]=ndgrid(1:5); xOut=zeros(size(m)); cou...

9 days ago | 1

Answered
Not enough input arguments for function length()
You are calling the a4_q3b function without input arguments. You did not give it any value for x, so when you try to use it, you...

9 days ago | 1

Answered
how to do sum of element of multiple number in matlab?
b=cumsum(m); b=b(c);

9 days ago | 3

| accepted

Answered
Delete patch in Matlab
Here is an example of what I wrote in my comment: t=linspace(0,2*pi,200); x=sin(t);y=cos(t); x=[x 0 0 2 2 -2 -2 0 0]; y=[...

10 days ago | 0

Answered
Copying all contents of a figure into another figure in Matlab GUIDE by clicking on a figure?
(Caveat: I haven't tried running any of this code) What are you expecting to happen when you set the ButtonDownFcn? It doesn't ...

10 days ago | 1

Answered
imresize(...'bilinear') and interp2(...'linear') return different results
It is a bit hidden away in the documentation, but it has to do with antialiasing when shrinking an image: x = [0 0 1 1;... ...

10 days ago | 0

| accepted

Load more