Community Profile

# Rik

##### Last seen: Today
2,645 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.

View all

Contributions in
View by

How to plot based on the shortest vector?
I was just about to comment something along the lines of the answer @Scott MacKenzie posted. The idea is that you find out what ...

8 hours ago | 1

How to remove cells in cell matrix that are a certain value?
data(all(cellfun('prodofsize',data)==1),:)=[]; You might need to specify the dimension for the all function (writing of mob...

12 hours ago | 0

| accepted

issue when creating and saving file to specific folder
You shouldn't use cd outside of debugging. In general using a full path is a much better idea with better performance. The ca...

2 days ago | 1

Why do I get a wrong answer when I use FIND function in this case?
When you subindex a variable before using find, it will return the indices relative to that subindexed variable. This is because...

2 days ago | 1

| accepted

why do ı receive the error "data must be numeric, datetime, duration, or an array convertible to double". How can I fix it?
Extent is still a symbolic by the time you try to plot it. You need to convert it to a double. Since you omitted the definition ...

2 days ago | 0

Record every 12 values in a loop
Using a cell as an intermediate step is generally not efficient, but it tend to be easy to work with. With that in mind: you ca...

3 days ago | 0

using parts of matrix with different sub-vectors (Matlab)
Shouldn't something like this work? Hc = H((T*(ess-1))+1:end,((N*2)*(ess-1)+1:N);

3 days ago | 0

| accepted

Create a new array over each iteration
The code below gives you what you want. The only difference is that you need to write my_data{1} instead of my_data1. [~,~,data...

5 days ago | 1

| accepted

if statement with ge and &
You should write this instead: if j >= 2 && cANALY(i+1,j-1) < 0

5 days ago | 0

Using strfind or regexp in cell
Your intuition that you can use a regular expression is correct: data={... 'METAR ESSA 202008010020Z 28003KT CAVOK 10/09 Q...

8 days ago | 0

| accepted

Submitted

BlandAltmanPlot
Create a Bland-Altman plot and return a struct with results and handles.

How can i solve function with an dependent variable?
Below I show the structure of a possible solution. The rest is up to you. Feel free to comment if you have a specific question. ...

9 days ago | 0

| accepted

How to name variable with file name?
You shouldn't do that. If you give all the same name, you will get a struct array when you load everything. for file=1:3 m...

9 days ago | 2

| accepted

Problem with fitting an experimental curve
Your function doesn't fit the data well. You should probably consider using an offset term as well. S=load(websave('data.mat','...

10 days ago | 0

| accepted

How to draw ROI on MRI images ?
drawpolygon should do the trick. Then createMask will get you a binary mask which you can use for further analyses.

10 days ago | 0

counting number of times a string appears and graph in histogram
The count function is doing exactly what you ask it to: you provide it with an array, it returns an array with 1 fewer dimension...

10 days ago | 0

Run Python outside of Matlab
In such cases I tend to write .bat files and start them: system(['start "" "' fn '"']); %The first "" is required, because oth...

11 days ago | 0

| accepted

sum of multiples of 3 from 0 to 100
If I was your teacher I would just tell you to use a loop, leaving you to decide what you aren't allowed to do. In this case ...

14 days ago | 0

It might be enough to use mean on the second half of your vector. Sometimes a simple solution will already do the trick. The ...

14 days ago | 0

when we call for boxplot function, is there any setting to avoid that such function that evaluates outliers, so that the red crosses will be considered part of the distributi
Have you read the documentation? I expect setting Whisker to inf should do it. And indeed it does: boxplot([5;randn(100,1)],'W...

15 days ago | 2

| accepted

repeat values within array
You can edit your code using a cell array for the long way round: X=[0.5;0.5;0.6;0.6]; Y=[0.6;0.7;0.6;0.7]; dx=0.05; dy=0.05...

15 days ago | 0

How to get the user's installation path in my app designer?
If you want more control over where your persistent files are stored, I would suggest the GetWritableFolder. This will generate...

17 days ago | 0

applying for loop on variables
You know how to do indexing, so why did you make the decision to store data in a variable name? for k=1:3 rho_r{k}(1)=sqrt...

17 days ago | 0

Operator '*' is not supported for operands of type 'struct'.
You are using an output for the load function (which you should), but that means Matlab will load the data to a struct. I'm gues...

18 days ago | 0

sorting an string cell
You can use sortrows directly, or use code like this: [~,order]=sort(population(:,1)); population=population(order);

18 days ago | 0

The official reason is explained here. The unofficial reason might be that you're attempting to use a cracked version and your ...

18 days ago | 0

| accepted

Invalid expression. When calling a function or indexing a variable
Matlab variable names must start with a letter and may contain only letters, numbers, and underscores. Anything not fitting that...

18 days ago | 0

| accepted

fiting issue at certain value
You can either adjust your fitting function itself, or simply adjust the output: max(1,[ 1 0.98 1.02 1.1 1.3 ])

18 days ago | 0

| accepted

Hello everyone. How to make a matrix with unequal number of rows and columns, and make the number of rows and columns the same by adding zeros. Thank you very much.
This isn't too difficult, as Matlab automatically fills an array with zeros as it is expanded. S=load(websave('dataA.mat','http...

19 days ago | 0

| accepted