Answered
Gaussian Function Formula, cftool app.
a1 is an amplitude parameter defining the height of the guassian. b1 is the "mu" parameter defining the center. c1 is the "s...

6 years ago | 1

Answered
How to use matlab debugger
Matlab's factorial() function is being called somewhere when your code is executed. cumprod is a variable within factorial.m. ...

6 years ago | 0

| accepted

Answered
Invalid first data argument
All of the name-value pairs must come after all other input arguments. plot3(___,Name,Value) The first syntax is accepted bec...

6 years ago | 1

| accepted

Answered
How to avoid using for loops when declaring functions in a cell array
You only need 1 anonymous function if you include ii as a second input. ii must be a column vector and x must be a row vector. ...

6 years ago | 0

Answered
Compare two array values that meet criteria
Your example only contains 1 close-match of values between A and B that are +/- 15 units apart. % Raw data; A and B can be an...

6 years ago | 0

| accepted

Answered
The plot draws at y = -20, is there any way to force it to plot like normal (y=0)?
We don't have nearly enough information to understand what's causing those results. Shots in the dark include. You're using ...

6 years ago | 1

| accepted

Answered
how can I plot several vertical lines in graph?
In Matlab r2018b or later, you can use xline() to plot vertical lines or yline for horizontal lines. In MATLAB R2021a or later...

6 years ago | 1

Answered
How to fit linear regression models to a scatter graph
For a simple linear regression with a single predictor variable, you can plot the regression line using mdl = fitlm(tbl,'Mass~L...

6 years ago | 1

Answered
Adding years to my plot
This values 0:50 are probably indices (note that the first data point does not start at x=0). They could be durations too, I su...

6 years ago | 0

Answered
Matching string from multiple arrays
Here's a demo that identies exact datetime matches. It assumes you've already converted the timestamps to datetime values inste...

6 years ago | 0

| accepted

Answered
Obtaining the index of elements that belong to group
See the second output of datasample to get the selected index. [y,idx] = datasample(___) The problem you're having is that you...

6 years ago | 0

| accepted

Answered
Find different possible combinations of the rows of two matrices.
Fast & clean 2-liner: a = [1 2 3; 4 5 6; 7 8 10]; b = a + 10; c = [repmat(a,size(b,1),1), repelem(b, size(a,1),1)]; combos...

6 years ago | 0

Answered
Data representation with string header
If you have the Econometrics Toolbox you can use corrplot() to show a grid of correlations between all pairs of columns in your ...

6 years ago | 0

| accepted

Answered
How can I export the ANOVA results as a PNG?
> How can I export the ANOVA results as a PNG? If you're refering to the boxplot results, to save a figure as png, saveas(fig,f...

6 years ago | 0

Answered
Finding a matching pair of vectors between two matrix
Use [Lia,Locb] = ismember(A1,[XL;XR;XT;XB],'rows') Lia shows which rows of A1 are matches. find(Lia) shows the row numbers of t...

6 years ago | 1

Answered
How to know the date to which a group (findgroups) corresponds?
findgroups() Use the 2nd output [G,ID] = findgroups(A) G(i) belongs to ID(G(i),:). For example, A = ["D" "B" "B" "A" "D" "...

6 years ago | 0

| accepted

Answered
Change grid extent so title is visible
To vertically adjust the axis so the final title position is approximately where it would be from the top of the figure before r...

6 years ago | 0

Answered
How to detect the close window event for a "bar" graph
To invoke an action when the bars are deleted, use the DeleteFcn property of the bar object. Bars can be deleted using cla(), de...

6 years ago | 0

Answered
Is there any way that I Add a fourth row value to a find out 3x1 matrix?
mini_U(4,:) = 0

6 years ago | 0

| accepted

Answered
Is there any way to get a matrix from data set which contains x position, y position and magnitude?
Inputs are x, y, and m, which are your (x,y) coordinates and magnitudes, all the same length. Outputs are magMat and T. The ...

6 years ago | 0

| accepted

Answered
is there an alternative to pdist2 that calculates the distance between a matrices with different column numbers
You just need to transpose B d = pdist2(A, B'); d(i,j) is the distance between A(i,:) and B(:,j).

6 years ago | 2

| accepted

Answered
How to plot my "real-time" graphic in GUI?
The problem is not clear. Initially it sounds like you're asking for help using a PressButton function but that function isn't ...

6 years ago | 0

Answered
Vectorization and plotting user-defined function
To evaluate the integrals at each value in r, x = arrayfun(f,r);

6 years ago | 1

| accepted

Answered
how to solve multiple equations that use the same variable but different values
The goal is not clear but it seems like the question can be answered by indexing c. c = [3, 10] v(1) = (4*c(1) +150)/2; v(2)...

6 years ago | 0

Answered
How to reproduce original matrix, after deleting zeros from matrix for computations
Option 1. Replace the 0s with NaN values instead of removing them. Most Matlab functions either ignore NaN values or have flags...

6 years ago | 1

| accepted

Answered
How to define transparency of errorbar?
See this answer: https://www.mathworks.com/matlabcentral/answers/473325-how-to-make-errorbar-transparent#answer_489337

6 years ago | 0

Answered
How to make errorbar transparent?
Unlike many line plots, the color property cannot be used to set transparency in errorbar(). Transparency can be set from with...

6 years ago | 1

| accepted

Answered
How to copy a part of characters from each cell to a new matrix?
If you expect all elements of the cell array to have exactly the same format within the parentheses, ([number]°|[number]TM°) ...

6 years ago | 0

Answered
How can I set one lsline using gscatter?
Use coeffs = polyfit(x,y,1) to compute the regression line for all of the data and then refline(coeffs) to plot the regression l...

6 years ago | 0

| accepted

Load more