Community Profile

photo

Rik


1,303 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
Renaming folders with different names
You can use something like this %untested code list=dir('D:\ToM_3_LEVEL1_ONLY\ToM_00\*'); list=list([list.isdir]);%keep only ...

1 day ago | 0

Answered
uicontrol issues on figure
It may take some getting used to how to build a GUI with Matlab, but once you get the hang of it you'll find it gets easy. To ke...

1 day ago | 0

Answered
creating a vector from a bin count
You could of course do this with a loop (or cellfun), but I think a more elegant solution is with cumsum instead. data=[0 5; 1 ...

3 days ago | 0

Answered
how to make sure image resolution?
Some cameras store the orientation in the EXIF data, which Matlab generally ignores. In my PhotoAnnotation tool I used an extern...

3 days ago | 1

| accepted

Answered
Joining every eight columns in a matrix
Although it might visually be joining characters, that is not necessarily what you need. The code below should be one of the fas...

4 days ago | 0

Answered
how can i find mean of a plotted graph?
The thing you are asking is slightly different from what is generally meant with 'mean'. The code below shows two interpretation...

4 days ago | 2

| accepted

Answered
how to run same command for sequence of files
Use a loop. Using numbered variables is generally a bad idea. Consider using an array to store everything. If you use the same n...

4 days ago | 0

Answered
to print following pattern
You mean like this? for k=1:9 a=str2double(char('0'+(1:k))); b=a*8+k; fprintf('%d x 8 + %d = %d\n',a,k,b) end

4 days ago | 1

| accepted

Answered
Insert blank/NaN rows in a column
This example should work. Don't forget to add NaN values to your x-parameter as well. Alternatively, you could plot them as sep...

5 days ago | 0

| accepted

Answered
create columns with for loop
This should help you solve it: Rows_I_need=[500, 1000, 2500]; %generate random array as input array=randi(3,4000,1); %get ...

6 days ago | 0

| accepted

Answered
How can i extract numerical intensity values from an image
You can make use of the fact that an image is already a matrix. Instead of ndgrid (as used in this code), you could also conside...

6 days ago | 0

| accepted

Answered
Calculate the volume of a CAD part
An example to work with would make this easier to answer. The bounding box should be fairly straightforward: just take the min ...

6 days ago | 0

Answered
Using loop instead of hardcoding
Please post your code as code instead of a picture. What exact function are you using? The only midpoint function I can find in ...

6 days ago | 0

Answered
Plot a my own created function
Your output is sometimes complex. You should fix this in your function, but you can also apply a quick fix here: fplot(@(Lambda...

9 days ago | 0

| accepted

Answered
Find the earliest common date and indicator of two date vectors.
This answer assumes you have your dates in a datetime format. If you don't it should be relatively easy to convert to it. If you...

9 days ago | 1

Answered
"patch" command error
I suspect you generated the vertex IDs in a programming language that is zero-indexed, instead of one-indexed. If that is the ca...

9 days ago | 0

| accepted

Answered
Figure editing shortcut missing
Edit: You can open the plot tools with the plottools function. You can probably add this as a custom button, but otherwise the ...

9 days ago | 1

| accepted

Answered
Presenting 48 images in 4 conditions where each image is presented only once?
Do you mean something like this? %generate some empty structs for testing %(replace by appropriate calls to the dir function) ...

10 days ago | 0

Answered
Will m files work that were made in matlab R2018a work in matlab R2017b?
You can check the release notes to see if you're using functions that were introduced in R2018a, but I suspect from your descrip...

11 days ago | 1

| accepted

Answered
How to convert row and column data into x,y,flag format?
BW1=[0 0 1;1 1 0];%example matrix [Y,X]=ndgrid(1:size(BW1,1),1:size(BW1,2)); data=[X(:) Y(:) BW1(:)];

11 days ago | 1

Answered
Intensity profile of an image
improfile should work

11 days ago | 0

Answered
How to append data from multiple runs of script without overwriting previous data.
Use one of the append options from fopen: 'r' Open file for reading. 'w' Open or create new file for writing. Discard existing...

11 days ago | 0

| accepted

Answered
need help the mean of this code
This is horrible code. I would strongly suggest not using it. However, it should be easy to see what is happening if you go thr...

11 days ago | 1

| accepted

Answered
Get time/date online
Slightly expanding the above solution by Vincent, the attached code should work on all Matlab releases, as well as GNU Octave. I...

12 days ago | 0

Answered
evalin('caller','mfilename') does not work.
Depending on your release you can get the complete names including the path from dbstack (in v6.5 you couldn't, but already sinc...

13 days ago | 1

| accepted

Answered
How do i make figures plotted in Matlab to appear in a chronological order?
You can bring focus to a figure with the figure function: h=struct; h.f=zeros(1,5);%will contain the handles to the figures f...

13 days ago | 0

| accepted

Answered
How do i load a file automatically in a particular folder just by a part of the filename?
folder='C:\Path\To\Your\Data'; list_of_files=dir(fullfile(folder,'Annot*')); %remove any matching folders list_of_files([li...

13 days ago | 1

| accepted

Answered
An accumulating matrix to be reset when the limit value is reached, the value being reset must be moved to another matrix
This should do the trick. Note that you should use numel to count the number of elements, not length, which is just doing max(si...

14 days ago | 3

| accepted

Answered
Calling a callback function in GUI
Your problem is not taking into account the full potential of callbacks. You throw away the handle to the object you're using. Y...

14 days ago | 1

| accepted

Answered
passing variable from one callback to another callback in gui
Store the value of k inside your guidata struct.

14 days ago | 0

Load more