Community Profile

photo

Rik


1,177 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
Matlab code to psudocode
I will do you one better: I will write comments with each line, which the writer of this code should have done. Then you can eas...

1 day ago | 0

Answered
How I can fix "Matrix dimension must be agree"
Your error is due to the sizes not matching. This can be solved using implicit expansions, which is automatically enabled since ...

1 day ago | 0

Answered
Matlab App designer - use 'close all' without deleting GUI
You can use handles returned on the opening the figure to close them: f=figure; %some interaction with the figure plot(rand(2...

1 day ago | 0

Answered
help understanding cell and (end+1) use
The end keyword (when used in indexing) is converted to the size of that dimension. %example: A=rand(1,2,5,3); A(1,1,end,1)=2...

1 day ago | 0

| accepted

Answered
How do I assign part of a matrix to be a variable
data=rand(9,10);%generate some random data a=data(1:3,:); b=data(4:6,:); c=data(7:9,:);

1 day ago | 0

| accepted

Answered
read file with ascii characters and binary data on one single line
If you are on Windows and opening the file with notepad a line feed (ASCII 10) is not enough to trigger a new line, as you will ...

1 day ago | 0

Answered
Histograms - Mean calculation - Comparing more pdf
For your first question: you can either use a categorical array, or set the xticks and xticklabels. You can calculate the progr...

1 day ago | 0

| accepted

Answered
How to put in the fprintf command without data printing limits.
Normally I am opposed to providing turn-key solutions to homework, but in this case I feel that the best way to explain is to sh...

2 days ago | 1

Answered
For loop not terminating when condition is met
Since Matlab stores values in a non-decimal representation, there is a lot of potential for round. In general you should be usin...

2 days ago | 0

| accepted

Answered
Calling variables from a GUI into a script
You shouldn't be using a script, but you should use a function instead. That way you have encapsulated the process. You can use ...

2 days ago | 0

Answered
How could I passing parameters from .m file to GUI
You shouldn't change the function headers that GUIDE generates. The fact that your function is not in the same file doesn't matt...

2 days ago | 0

Answered
Wrap in a legend with num2str
If you use a newline character ( char(10) ), you can wrap the text. Here is some example code: figure(1),clf(1) h=plot(rand(1,...

3 days ago | 0

| accepted

Answered
How to write txt file contain double array and text header?
You can use repmat or sprintf to construct the FormatSpec. array=rand(3000,48); fid=fopen('test.txt','wt');%opening with the...

4 days ago | 0

| accepted

Answered
Cannot load MATLAB file properly
The dataset class is part of the Statistics (and Machine Learning) Toolbox according to the doc. So you will either need to re-i...

4 days ago | 1

Answered
Plot frequency along the y-axis without using a histogram
Please don't delete a question because you're not getting the feedback you want. Since you didn't provide any example data, I'l...

5 days ago | 1

Answered
Tracking the size of a variable
Yes. Set a break-point at the beginning of your function and go through your code step by step.

6 days ago | 0

Answered
Finding the closest neighbouring coordinates in 3D
As suggested here, if you have the statistics toolbox, you can use the pdist function. If you have more structured data (e.g. a ...

6 days ago | 0

| accepted

Answered
find the minimum RGB values of a pixel from an image
You mean like this? RGB=uint8(255*rand(100,100,3));%random RGB image temp_IM=sum(double(RGB),3);%sum the three color channel...

8 days ago | 1

Answered
Calling nonlinear constraints before objective function
You could let your objective function return inf when invalid parameters are provided. Then any minimizer will avoid values resu...

8 days ago | 1

| accepted

Answered
v(t) is not defined help me!
This code should work: m=70; g=10; c=10; t=0; v=0;n=0; while t<7*log(100) t=t+0.1; n=n+1; v(n+1)= v(n)+0.1*...

8 days ago | 0

Answered
retrieve binary data back
In case you wanted to accept my answer, I'll repost my code in an actual answer. However, I would suggest you use Madhan's solut...

9 days ago | 2

| accepted

Answered
i created function works on 3*3 matrix how i make it work on 9*9 mat with loop?
This should work better: function tf=checkunit(a,tol) %Check matrix for unique values %This function returns true when no dup...

9 days ago | 0

Answered
replace duplicate entry in columns
I expect this code does what you want. The order in which the array is processed matters, so you need to make sure that this sat...

9 days ago | 0

| accepted

Answered
how to display / recall data in matlab
As long as the input array A has sufficiently unique values, you can use either ismember or ismembertol. A=[10 20 30 40 50] bl...

11 days ago | 0

Answered
Flow of information in callback functions
You can find some more information in the documentation. The @ creates a function handle. There are two options here: an anonym...

11 days ago | 0

| accepted

Answered
Circle interpolation (calculate the values inside)
If you want to fill a circular area with a particular color, you can use this code: center=[10,20];%xy coordinates of the cente...

11 days ago | 0

| accepted

Answered
Why can't i plot a graph for a against t?
Here are some variations you could try: k_n= 7*10^-11; n= 2; i=1; dt=1/3600; %1sec interval t=zeros(1,floor(2.5/dt)); %in h...

12 days ago | 2

Answered
How to loop over a series of files
Your mistake was numbering your variables. However, you can use eval to solve your current problem. You should avoid eval. Make...

12 days ago | 0

Answered
Running average using for loops
I guess boldly: If you want a sliding window average, you can use a convolution: data=magic(8);data=data(:);%generate some dat...

13 days ago | 2

| accepted

Answered
how to modify contrast in multiple dicom images using slider GUIDE
You can use the callback of the slider to adjust the caxis. In my FEX submission WindowLevel I do something similar, but with d...

13 days ago | 0

| accepted

Load more