Community Profile

photo

Rik


1.426 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 Read text file as array form , Please
The code below should get you most of the way there. The idea is to parse each element and then remove it from the variable, so ...

23 minuti ago | 0

Answered
Automation/Rerun the program for different inputs automatically.
This is trivial if you put your code in a function: function price=getPrice(Rows,Columns) price=sin(Rows)*exp(Columns);%whatev...

circa 2 ore ago | 0

Answered
How to use Prod function with cell arrays
It is always good to consider if the task you want to accomplish asks for a different data design. I think it is much easier to ...

circa 6 ore ago | 0

Answered
pairs of consecutive numbers
I have expanded your example array a bit to more clearly show the indeded effect. I have replicated the effect of your code, ple...

circa 11 ore ago | 1

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=...

circa 24 ore 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...

1 giorno ago | 0

| accepted

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...

1 giorno 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...

2 giorni 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.

4 giorni 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...

5 giorni 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...

5 giorni 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...

6 giorni 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...

6 giorni 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...

6 giorni 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 = [...

7 giorni 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.

7 giorni 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 giorni 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; %...

8 giorni 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 giorni 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...

10 giorni 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...

13 giorni 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...

15 giorni 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...

15 giorni 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...

16 giorni 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...

18 giorni 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 giorni 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 giorni 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...

20 giorni 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...

20 giorni 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 ...

21 giorni ago | 0

| accepted

Load more