Community Profile

photo

Rik


Last seen: Today Active 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.

Statistics

All
  • MATLAB Central Treasure Hunt Finisher
  • 36 Month Streak
  • Ace
  • Draw Letters
  • Community Group Solver
  • 5-Star Galaxy Level 5
  • GitHub Submissions Level 3
  • Indexing I Master
  • Cody Challenge Master
  • Introduction to MATLAB Master
  • Speed Demon
  • Leader

View badges

Content Feed

Answered
Averaging scattered data over an n by n grid
Here is a full solution, using histcounts2 and accumarray to do the heavy lifting. This solution plots in 3D, so you can verify...

environ 24 heures ago | 1

| accepted

Answered
Greek letters Latex interpreter
You need to turn math mode on: plot(rand(10,2)); ylabel('Shear stress $\tau$ [MPa]', 'fontsize', 11, 'interpreter', 'latex')

1 jour ago | 0

| accepted

Answered
What are these commands in Matlab? Can any one explain them with examples. I searched them but didn't find any help
The first line is accessing a field iqDAC of the struct metadata, which it transposes. The second line divides two variables. ...

1 jour ago | 0

Answered
Fill a matrix with matrix powers
n=3; A=rand(n,n); Zero=zeros(size(A)); C=repmat({Zero},n,n); C(logical(eye(n)))=arrayfun(@(n)A^n,1:n,'uni',false); C=cell2m...

2 jours ago | 0

Answered
How to solve the erro about fzero function?
Your custom function should return a scalar value, but it doesn't: fun = @fun_ball; Trq0 = 10; fun(Trq0)

2 jours ago | 0

Answered
How do I sort automatic variables in matlab?
You shouldn't generate variable names dynamically. You should use an array instead. That way you can use all the normal Matlab t...

3 jours ago | 1

| accepted

Answered
Poor display of DICOM images using MATLAB (dicomread)
dicomread does not change the file in any way. Most medical viewers will use a subsampling. The viewer I use, uses an 8x8 biline...

3 jours ago | 0

Answered
need help making a 'for' loop to make a new matrix
Having numbered variables is a problem that should be solved when you create those variables. If you have 40 variables with the ...

4 jours ago | 1

Answered
simple combinations between cells
It can probably be done without a loop, but why do you want that? Loops are very efficient (as long as there isn't a builtin vec...

4 jours ago | 1

| accepted

Answered
How do I find the maximum and minimum of a function in a given domain?
You need a function like fminbnd: y =@(x) (1*x.^4)/4+(4*x.^3)/3- 5*(x.^2)/2; x_min = fminbnd(y,-3,3) Let's confirm this with ...

6 jours ago | 0

Answered
adding two matrices of unequal length
Result=A+B(1+mod(1:size(A,1),end-1),:); (written on mobile, untested code)

6 jours ago | 1

| accepted

Answered
extracting the last three characters from cell array
You probably want to extract the extension, instead of hard-coding the last three characters: data={'COD0MGXFIN_20210870000_01D...

7 jours ago | 1

Answered
Calculate mean from a cell array.
Two options of what you could mean: %load your data first websave('data.mat','https://www.mathworks.com/matlabcentral/answers/...

8 jours ago | 0

| accepted

Answered
Assign values in the cell
You mean like this? output1={[1 2;3 4],[]}; L=cellfun(@isempty,output1); output1(L)={zeros(8,1)}; output1 Note that cellfun...

8 jours ago | 0

| accepted

Answered
Right way to insert files paths into code
Personally I use a function like the one below to semi-hard-code the paths. The context for this is that I have a synced folder,...

9 jours ago | 1

| accepted

Answered
How can add stop button and command in GUI
The general solution is to have the stop button set a flag (either in the guidata or in the UserData property of an object). %i...

9 jours ago | 0

| accepted

Answered
string data type is not a class?
help methods This suggests that you can't use the methods(object) syntax for char and string inputs. methods('1') methods(cla...

10 jours ago | 0

| accepted

Answered
cell cal from function problem
If you pre-allocate the cell array you can use a comma separated list: [input1, input2, input3, input4]=deal(rand); AA=cell(...

10 jours ago | 0

| accepted

Answered
Getting around overuse of "if" statements.
You should use the value of DAY to set the value of a variable you can use as the range. You should also use strcmp to compare c...

11 jours ago | 1

| accepted

Answered
How to calculate a median value of each interval?
%generate some random data temperature=15+10*rand(8767,1); phase=360*rand(size(temperature)); temperature_rounded=round(tem...

12 jours ago | 0

| accepted

Submitted


JSON
Matlab/Octave JSON parser

15 jours ago | 7 downloads |

Answered
Have you figured out an easy way to publish your MATLAB projects for public consumption?
(this is not a drop-in solution) You could bundle your m-file with a copy of GNU Octave. The main upside is that it will be fr...

16 jours ago | 1

| accepted

Answered
How to plot the convolution of 2 functions
You didn't do the convolution on a function. However, since the vectors you did use are the y values of functions (with a shared...

17 jours ago | 0

| accepted

Answered
I want to load a folder in appdesigner by using "button" and to load the path of the folder in the "EditField". How?
The uigetdir function only has 1 output. folder = uigetdir(); if isequal(folder,0) ...

17 jours ago | 0

| accepted

Answered
extracting all lines includes specific string from text file
You can get my readfile function from the FEX. %If you don't use the readfile function, you can use readlines instead readfile...

18 jours ago | 1

| accepted

Answered
Subtracting Current and Previous Value of the same variable
No,that is not possible. What you can do is create a new variable which contains the previous value of a. Then you can trivially...

18 jours ago | 0

Answered
Pause execution of While loop and resume from the same point with PushButtons App Designer
The reason for your issue is that you're using toc, which will still continue running. If you measure how long your GUI has bee...

18 jours ago | 0

| accepted

Answered
I want to compare two arrays and check that which value is missing in second array as compared to first one?
You should avoid variable names like sum, as that will prevent you from using the sum function. Your question sounds like you n...

20 jours ago | 0

| accepted

Answered
Modifying a Variable if a condition is met
Array operation in Matlab tend to be much faster than other solutions. This is a situation where you can use logical indexing: ...

23 jours ago | 0

| accepted

Answered
Build a relation between matrix components
It is almost possible to use a convolution to solve your question, but I couldn't see how, so I did it with a replicated array. ...

23 jours ago | 1

| accepted

Load more