Community Profile

photo

Rik


1 422 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

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

View details...

Contributions in
View by

Answered
How to remove/rename part of a file name in a loop?
Something like this should work. Adapt as needed. list=dir('Hoverdofeightnosleevetriggered*.*'); for n=1:numel(list) old=...

environ 2 heures ago | 0

Answered
Skeletonizing a 3d voxel data
I generated some random points to show how your code should work. The attached function is an edited version of a FEX entry. Thi...

environ 10 heures ago | 0

Answered
random order of elements in array meeting some conditions
I'm not aware of any method that can do what you want. In the mean time, you can use the code below to improve the efficiency of...

environ 13 heures ago | 0

Answered
How to save nested cells in mat file
The code below is probably what you need (or close to it). If letters are used that are not in the letterlist, then an error wil...

1 jour ago | 0

| accepted

Answered
plotting a multivariable function by colors
You can use the surf function (and set the view so you look from above), or use ind2rgb to apply a colormap.

3 jours ago | 0

Answered
Matlab File not running when selected from a Zip file
Although Windows explorer can treat zip files as if it is a folder, Matlab does not. You will have to extract all required files...

4 jours ago | 0

Answered
Finding minimum points in a plot.
The movmin function might work for you. If you want us to help with the tweaking, you will have to attach your data or some code...

4 jours ago | 0

Answered
How can I do such a "averageifs"(excel) process in Matlab?
Using accumarray is probably better, but you can also use the unique function and a for loop to find the sum and the count. Edi...

5 jours ago | 0

| accepted

Answered
Conditional if statement solution
In Matlab calculating parameters for the entire array at once is almost always faster than a loop. My code below uses the find f...

5 jours ago | 2

| accepted

Answered
Pie chart without labels
No need for fragile findobj(ax,__) calls (which may return a lot more than just the pie labels). You can either set the labels t...

5 jours ago | 0

| accepted

Answered
How to arrange coordinates into 3 columns?
If you want to linearize an array, you can use (:): [XP_NODES,YP_NODES,ZP_NODES]=deal(XP_NODES',YP_NODES',ZP_NODES'); MESH = [...

6 jours ago | 0

| accepted

Answered
How to reset military datetime in matlab?
As you can read in the doc, the hh identifier is a 12h system. If you want 24h, you need to use HH in your format.

6 jours ago | 2

Answered
Solving 3 x 9 matrix all posible combinations
There are 4686825 possible combinations, so I would recommend not storing all of them, especially not in numbered variables, whi...

7 jours ago | 0

Answered
Same colormap with colorbar which has two axes
You can add a second tick row on the right side of the colorbar using the code below. f=figure; image c_handle=colorbar; %...

7 jours ago | 0

Answered
Question about imgaussfilt3
I don't see any indication otherwise in the doc, so you can safely assume that the sigma is in units of voxels. This should be e...

8 jours ago | 0

Answered
Modifying a structure array
Since you don't provide any indication of how you want this to work for struct array input, you'll have to modify this code your...

9 jours ago | 1

Answered
3 demension matrix coding - find largest NN elements
You will probably need to loop through the pages. The second output of max should be what you need. A=rand(4,4,5); out=A...

12 jours ago | 0

Answered
Can't take the mean of a 2D matrix (Array indices must be positive integers or logical values.)
You are using mean both as a function name and a variable name. Also, if you read the doc for mean, you will notice you can e...

14 jours ago | 1

| accepted

Answered
Loading from Workspace via string
The matfile function has an interface similar to what you're looking for. You do need to be careful with indexing if you want to...

14 jours ago | 0

| accepted

Answered
Replace multiple values in matrix / image
You can use ismember to remove a loop. I put in a loop over the colors, but since that is only 3 iterations, that will not cause...

15 jours ago | 0

| accepted

Answered
Replace specific string in structure
This should do the trick: %create part of your data structure as an example EEG=struct; EEG.event(1).type='11';EEG.event(1).l...

17 jours ago | 0

Answered
how to assign a number to a specific location.
I'm going to assume you want to treat table 1 as your lookup table, where you want matching column indices to have matching valu...

18 jours ago | 0

Answered
extracting number from a string
You can either use ismember to determine which positions contain the characters you're looking for, or you can use isstrprop. Th...

19 jours ago | 0

Answered
Workspace calculation accuracy 7 characters
There is a big difference between the display of values and how they're stored. They aren't stored in a decimal form (maybe with...

19 jours ago | 1

| accepted

Answered
Convert axis to image file/matrix
As KSSV mentions, print(gcf,'test','-dpng','-r300'); should do the trick if you want to print your entire figure content to a pn...

19 jours ago | 0

| accepted

Answered
How to get a centerline from a contour ?
First let's load the image into a usable format. You already have code to get binaryImage, so you can use that. %% read image ...

20 jours ago | 0

| accepted

Answered
How to run 'dicomanon' on all '.dcm' files in a directory (including all subfolders)?
Use the dir function to generate a full file list and then loop through them. list=dir('C:\path\**\*.dcm');

22 jours ago | 0

Answered
How to write this in matlab?
Because of the recursion limit (and other factors), it is smarter to implement this in a loop, instead of a recursive function. ...

22 jours ago | 0

Answered
Problems when running GUI graph plotting with 'while' or 'if' loops
You should be using strcmp to test if a char array is equal to another char array. Your current tests are array operations. A...

23 jours ago | 0

| accepted

Answered
how to insert 1 in place of inf in a given array
You can use the diff function and isinf to make this array. final= [false diff(array)==0] | isinf(array) ;

23 jours ago | 2

| accepted

Load more