Community Profile

photo

Rik


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

  • 12 Month Streak
  • Revival Level 3
  • Guiding Light
  • Thankful Level 2
  • Knowledgeable Level 4
  • First Answer
  • Solver

View details...

Contributions in
View by

Answered
Rebuild the matrix according to the values of its elements
You mean like this? It is unclear to me how you would like to use your example situation without an x and y. xm=6; ym =3:0.01:1...

7 hours ago | 0

Answered
For loop count question
Initialize count to 0 before your nested loop and do count=count+1; inside the inner loop.

11 hours ago | 0

Answered
How do I write a Roulette Code?
n_games=100; your_number_pick=34; Red=[1:2:9 12:2:18 19:2:27 30:2:36]; Black=[2:2:10 11:2:17 20:2:28 29:2:35]; roulette_...

2 days ago | 0

Answered
"at most" in MATLAB
This code should help: check =[1 4;2 5;3 6]; %i=2;j=3; i=5;j=3; matches_per_col=sum(check==i | check==j,1); if max(matches_...

2 days ago | 1

| accepted

Answered
how to delete the previous plot obtained using slider in GUIDE
The easiest way to accomplish this is to create the second plot first, using the same positions as the first plot (which will th...

3 days ago | 0

Answered
How can i make my code interactive?
You aren't checking if the values are valid. That means you're never changing the value of valid, which results in an endless lo...

3 days ago | 0

| accepted

Answered
How do I separate a string with hyphen and colon separation within cell
If you know the pattern you can simply use that to edit the FormatSpec: fileID=fopen('RD-180531-160600.txt'); FormatSpec='%4s-...

3 days ago | 0

| accepted

Answered
Justify text in MATLAB Live Editor
Yes, the buttons to allign text are in the lint:

3 days ago | 0

Answered
iam getting error while iam debugging the code in matlab 2019, But it is excuting in matlab 2014 version.... Iwant this in MATLAB 2019 please help me
There are only two relevant lines from your enormous blocks of code (that you didn't format yourself): %initial post: h_16qam=...

3 days ago | 0

| accepted

Answered
Replace matched values with a cell array keeping unmatched values unchanged
This code should help A = '[0, 40, 50, 60, 80, 100, 140, 160, 200, 300]'; B = '48 43 533 6320 ...

3 days ago | 0

Answered
How to campare index number of a matrix with other
A=[ 9 8 5 4 4 10]; B=[1 1 1 3 3 3 2 2 1 1]; newA=B(A);

3 days ago | 1

Answered
How can I multiply axis values by 1000 without changing the data?
You can either multiply the y-values with 1000, or use the YTickLabels: ticks=get(gca,'YTicks');%retrieve current ticks ticks=...

7 days ago | 0

Answered
regexp for time - cannot guess it
If you know this format, maybe a regexp isn't the right tool for the job. function s=parse_time(str) c=regexp(str,'\.','split'...

7 days ago | 0

Answered
read empty line by textscan
If your file doesn't contain any special characters, you could try fileread (which reads a file as one long char array), then sp...

8 days ago | 2

| accepted

Answered
Subtraction of 2 matrices of the same dimensions and values, gives large floating point values instead of 0!
Welcome to the world of floating point calculation. Computers store values in binary, which sometimes requires rounding. This ro...

8 days ago | 1

| accepted

Answered
How to find the local mean of an image?
The fastest way to get a local average is to do a convolution with a flat structuring element: %load example image A=imread(['...

9 days ago | 0

| accepted

Answered
How to calculate the shortest distance between points and a line?
You can use the point_to_line_distance function.

9 days ago | 0

| accepted

Answered
Can isstrprop search for 2 properties?
I would convert to double type and use ismember to check if all characters are allowed. Alternatively you could just convert ...

9 days ago | 1

Answered
EULER'S METHOD GUI HELP
You are using str2num (which you shouldn't), and you are setting a numeric vector as the string property. You may need to consid...

9 days ago | 1

Answered
How do i create checkboxes near each plots in a subplot window ?
You can use uicontrol('Style','checkbox').

10 days ago | 0

| accepted

Answered
Matching based on working days
You can use the weekday function. You can easily adapt the function below to apply specific shifts. A=datenum({'2019-04-07','20...

10 days ago | 0

| accepted

Answered
Two differente program to write in the same place
This is just a simple concatenation: function output=xx output=[main transfer]; end function output=main output=rand(19,6);...

11 days ago | 0

Answered
help with this 02 questions please
For question 1: link For question 2: you can create a CloseRequestFcn that also closes the secondary app link.

11 days ago | 0

| accepted

Answered
Memory issue to create 4D array
The amount of data is probably huge, is not pre-allocated and will probably not fit in memory. Have you calculated an estimated ...

11 days ago | 0

Answered
Finding pythagoras triples when only c is known
You are quite close. The code below contains some optimization in terms of selection of values to check, and the check is modifi...

11 days ago | 1

Answered
how do i read a folder database into matlab
Use uigetdir to ask the user for a folder, then use dir to get the list of files inside that folder, then use a for loop to load...

13 days ago | 0

| accepted

Answered
if statement not working
What you probably think should happen is in the code below, however, there is a better way. A = [5;5;5;3;3;2]; B = [10;4;10;10...

13 days ago | 1

| accepted

Answered
How can I change from Cell to Double and writing in many lines
The code below should do what you want. %generate input A=cellfun(@(x) {x+rand(6,6)},num2cell(1:19)'); %convert the cell co...

13 days ago | 0

| accepted

Answered
Round to Nearest Multiple of 4.
a=45; k=4; b=k*round(a/k);

13 days ago | 1

| accepted

Answered
sequential file reading and operations
That is not how the textscan function works. You should read the documentation for the functions you are using. figure(1) root...

14 days ago | 0

| accepted

Load more