Answered
The fastest method to perform sum of function
dx = 0.1; dy = 0.15; dz = 0.05; xmin = -2; xmax = 4; ymin = -2*pi; ymax = 2*pi; zmin = -1; zmax = 2; xs = xmin:dx:xmax;...

2 years ago | 0

Answered
train a Neural network with different input output sizes
If it's a sequence-to-one regression then this syntax of trainNetwork would be appropriate, net = trainNetwork(sequences,respon...

2 years ago | 0

| accepted

Answered
Extrapolating x from a given y value using a curve-fitted cfit equation.
x=fzero(@(z) val(z)-y, z0)

2 years ago | 1

Answered
Two-variable optimization with additional conditions
The constraint is equivalent to minimizing over the intersection of the unit sphere and a plane through the origin (normal to n0...

2 years ago | 0

Answered
What could be the reason for this fzero error and how to solve it ?
You should plot the function to get a better idea where the solution is, dd = 0.1069; vv = 0.7889; L = 1; fun = @(aa) ( (...

2 years ago | 1

Answered
How to change size of plot points
savtotal=1000; % initial amount hold on xlabel("Time (Months)") % graph labels ylabel("Amount Saved ($)") title("College Sav...

2 years ago | 0

| accepted

Answered
How to apply for loop in case of product of function inside double summation?
The most efficient approach, especially as a and b become longer, is to separate the sums, leading to a one-line computation: P...

2 years ago | 1

Answered
Remove points in a 3D matrix that lie inside a 2D polygon on each layer
and effectively eliminate a column from the mri by adjusting the values of all points within that same polygon to 0 on every sli...

2 years ago | 0

| accepted

Answered
How to segment a matrix into N regions with sizes XYZ?
I'm not sure how to do an area-preserving transformation in Matlab See imwarp.

2 years ago | 0

Answered
Need help graphing gradient of 2D polynomial
[Gx, Gy] = differentiate( sf, X, Y ); figure; surf(X,Y,Gx); title('X-Gradient') figure; surf(X,Y,Gy); title('Y-Gradient')

2 years ago | 0

Answered
I want a Matlab Program for creating a single frame with combined plots of a surface plot of a two-dimensional standing wave field in addition to an image of projection plot
x = linspace(-1, 1, 100); y = linspace(-1, 1, 100); [X, Y] = meshgrid(x, y); frequency = 1; amplitude = 1; Z = amplitude * sin...

2 years ago | 0

| accepted

Answered
Using lsqcurvefit for parameter optimisation
Since you are just trying to verify the results of a previous paper, initialize with the solution parameters that the paper prov...

2 years ago | 0

Answered
returning a unique array and comparing it with a different array.
The whole thing can be done in one line. No need for unique, reshape, or any of the rest of it. result = ismembertol(a,y_cosno...

2 years ago | 0

| accepted

Answered
Improving performance of parallel code sections
The task is too small for parallelization to have any meaningful effect. Similarly, the relative performance numbers for the dif...

2 years ago | 0

Answered
Is it possible to have a line graph with a different marker for each point on the same line?
You can effect that as below. I don't see why you'd want it, however. x = 1:5; y = [2, 3, 1, 4, 2]; xc=num2cell(x); xc{end+...

2 years ago | 1

| accepted

Answered
Fminsearch does not work after increasing maxiter
The warning is not coming from fminsearch. It is coming from the ODE solver. As fminsearch iteratively explores different choice...

2 years ago | 0

Answered
How do I make the fit better so that there are no negative y-values for the fit?
Why use fit() if you just want to interpolate? Why not use interp1 with the 'pchip' method instead? clc; clear all; %% --Va...

2 years ago | 0

| accepted

Answered
How do I make a secondary Y axis
It is, unfortunately, a very awkward thing to do. The datatip will show y3 with an increment of 200, but there may be ways to cu...

2 years ago | 2

Answered
How to get equispaced values with a more exact result than using linspace and column functions?
I want exactly equispaced output There is no such thing as exactly anything in floating point computation. The inaccuracies you...

2 years ago | 1

Answered
MATLAB won't run script unless functions are defined in a specific order?
As long as all your functions are placed at the bottom of the script, it shouldn't matter what order they are in.

2 years ago | 0

Answered
Sort function indices in regards to the original data?
[val,is] = sort([86.9565 69.5652 65.2174 52.1739 43.4783 65.2174 91.3043 60.8696],'descend'); idx=1:numel(val);...

2 years ago | 2

Answered
How to split array into sub arrays?
a = [1 3 5 8 11 12 15 17 18 19 20 21 24 29 31 32 33 34 35 36 38 39]; G=findgroups(discretize(a,[0:10:max(a)+10],'Include','ri...

2 years ago | 0

Answered
Cubic interpolation coefficients and basis matrix
Using this FEX downloadable, https://www.mathworks.com/matlabcentral/fileexchange/44669-convert-linear-functions-to-matrix-form...

2 years ago | 0

| accepted

Answered
Getting points back from convexhull/trisurf, or 'how to find the closest point on a 3d surface to a given point.
This might be what you're looking for, https://www.mathworks.com/matlabcentral/fileexchange/52882-point2trimesh-distance-betwee...

2 years ago | 0

| accepted

Answered
How to get a smooth boundary between clusters?
Once you've extracted the boundary points, you could use sgolayfilt to smooth them.

2 years ago | 1

Answered
Computation of the distance of the points from the interpolation curve?
dist = pdist([flowrate y], 'euclidean','Smallest',1);

2 years ago | 1

Answered
Which algorithm does SVD function take?
The SVD algorithm is not disclosed by MathWorks, but even if you could be sure the same algorithms were used by both Matlab and ...

2 years ago | 2

| accepted

Answered
shade the area between curves
% Define the data as column vectors x1 = [0.001 0.055178 0.06313 0.071457 0.072486 0.089794 0.099338 0.099518 0.107103 0.118855...

2 years ago | 0

Question


How to detect whether a figure is created by uifigure()
I have the following in my startup.m file, set(groot,'defaultFigureCreateFcn',@(fig, ~)addToolbarExplorationButtons(fig)); ...

2 years ago | 2 answers | 1

2

answers

Answered
Can I upload the results of my work with a home license to GitHub?
I don't think any of the licenses restrict your ability to share your code, with the obvious caveat that if you try to sell it ...

2 years ago | 0

Load more