Answered
How to do Downward peak detection?
You can use the MATLAB function islocalmin for example idx = 1:length(A) isMin = islocalmin(A); plot(idx,A,idx(isMin),A(isMin...

6 years ago | 0

Answered
Problem of Nonlinear Regression
If you have the Statistics and Machine learning toolbox you can use fitnlm or nlinfit see documentation https://www.mathworks.co...

6 years ago | 1

Answered
How to compare array's values with each other?
Staying close to what you have started here, you could put your code into a double loop, for example % assign threshold z = 10...

6 years ago | 1

Answered
Help deal with the loop
You do not need a loop to evaluate this type of expression in MATLAB. The beauty of MATLAB is it lets you do math directly with ...

6 years ago | 0

Answered
Which Matlab tools suit for substance manipulation and energy flow simulation?
The Mathworks Simulink program, is a very flexible, and powerful, block diagram oriented tool for simulating systems that can ...

6 years ago | 0

Answered
Is it possible to run a function that requires input variables when they are declared later in the function?
You just need to give your first function a return argument when you call it. So the definition of your first function should...

6 years ago | 0

Answered
Delete rows with bad data and surrounding rows
Here's another approach % script to clean data B = [0 1 0 0 1 0 1; 0 0 0 0 0 0 0; 0 1 0 0 1 0 1; 0 1 0 0 0 1 ...

6 years ago | 0

| accepted

Question


How to use timetable with hierarchical data
I have made wide use of MATLAB tables for analyzing my experimental data. Since much of my experimental data is time based (meas...

6 years ago | 1 answer | 1

1

answer

Answered
Split table from database into sub-tables dependent from timestamp difference
First I would recommend making a new column in your table with the time expressed as a MATLAB datetime array, for example you co...

6 years ago | 1

| accepted

Answered
How to make a loop for all participants to delete rows that contain a certain value
Your loop does not seem to make any sense Having a for loop such as for j = 1:length(DATA(ii).GAIT_INFO); means that j ...

6 years ago | 0

| accepted

Answered
How can I create a fullpath from images of different subfolders?
Its not quite clear from the snippet of code and description you give but I think your problem is that you are not constructing ...

6 years ago | 1

Answered
Intersection of two linear lines in 3D
It is a little hard to follow from your desription but I'm assuming you have 2 three dimensional curves that intersect. So eac...

6 years ago | 1

| accepted

Answered
Splitting up data vector into matrix with weekly data separated by columns
I think the key challenge is to find the index (row number in your table) where the end of each week occurs. Here is one way you...

6 years ago | 0

| accepted

Answered
Pair a row index with a column index
This can be categorized as a Matching problem. In particular it can be mapped to a Matching problem on a Bipartite Graph. Let's...

6 years ago | 1

| accepted

Answered
Finding a max in a column and making all other elements equal to zero
I see that as I was working on this Joel had already given you an answer, but here is another approach in case it is useful % t...

6 years ago | 0

Answered
Timetable with 15 min averages
Try this for your fourth line (and skip your third line assigning new_times, as it is not needed with this approach) house_loa...

6 years ago | 3

| accepted

Answered
Need to store each index and value from if statement inside the for loop.
You can also do all of that without any loops as follows % load the data load data % assign the y vector to the data y = d...

6 years ago | 0

Answered
How to save all opened window Figure (imshow) with specified name and folder?
The problem is that in your inner loop you set i = 1,2,3...7 but you are writing currentImage{k}. So the index for k does not ch...

6 years ago | 1

Answered
How to integrate an unbounded function?
According to the MATLAB documentation https://www.mathworks.com/help/matlab/ref/integral.html MATLAB's integral function can han...

6 years ago | 1

| accepted

Answered
How to remove the outliers
Since you do not have filloutliers and rmoutliers in your version of MATLAB I would first recommend updating to a more recent ...

6 years ago | 1

Answered
How to convert a For loop function into an If function
First, I think when you are saying "recursive" you mean "looping". While and For loops aren't inherently recursive. A recursive ...

6 years ago | 0

| accepted

Answered
Non linear system of equations with constraints.
If you would like to apply some inequality constraints using lsqnonlin, you could do this by creating some auxilliary variables....

6 years ago | 0

| accepted

Answered
Dimensional error using PCA
The first argument to pca should be n by p, where n is the number of observations. You are supplying it with a p by n matrix. As...

6 years ago | 1

| accepted

Answered
Find and edit interval of array when element is equal to a value?
Here is another approach, which basically relies on an earlier contribution from Jan with a small modifications for your problem...

6 years ago | 1

| accepted

Answered
Numeric answer for PID command
In order to simulate the time response of a system using the MATLAB control system toolbox you can use the lsim function. Note i...

6 years ago | 0

| accepted

Answered
How to vary the color of a dynamic line?
I was just trying to code up an example, but when I finished I saw you already had an answer from Adam. My solultion used a simi...

6 years ago | 1

Answered
having problem to solve somthing in matlab
If you think about how basic matrix, vector multiplication works, you can see that you can sum rows of a matrix by multiplying b...

6 years ago | 0

| accepted

Question


File attachments in MATLAB Answers open as links
When I try to download file attachments included with posts to MATLAB answers they instead open in my Chrome Web Browser. If the...

6 years ago | 1 answer | 0

1

answer

Answered
Building the legend according to user input.
It is a little hard to understand all of the details of what you are doing in your code, and what exactly you want to produce fo...

6 years ago | 0

| accepted

Answered
Different grid lines color in MATLAB
The grid is a property of the current axis. After you draw your figure, and add the grid, you can set the GridColor property of ...

6 years ago | 1

Load more