Answered
Get separate index from a column with separate conditions
Remember, you are in a world of finite precision computers... ftol=@(t) abs(TIME-t)<smallnumber; %compare to within a tole...

3 years ago | 0

| accepted

Answered
Include all possible combinations in loop?
%% 'ConcreteData' (matrix 1030x8) R2_all = (value1,value2,value3,value4,value5,value6,value7,value8) %%pre-defined values exit...

3 years ago | 0

| accepted

Answered
How can I turn xyz position data with a hole into a closed surface to do more sophisticated lighting and transparency settings?
and my best attempt at a surface using boundary() You could try alphaShape instead. Choose the alpha radius to be slightly larg...

3 years ago | 0

| accepted

Answered
Issue with trainNetwork() function
I am trying to interpret what and how this darker blue field of the training plots means, The light blue line measures accuracy...

3 years ago | 0

| accepted

Answered
How to input 2D array data for Deep learing toolbox model, not image file
Currently, the data is in CSV format, but I can convert it into a suitable 2D array. An imageDataStore has a ReadFcn property ...

3 years ago | 0

Answered
Combine .mat files with 1x1 struct with 11 fields (tables)
Files=compose("eCRF%.3d", (1:200)); S = arrayfun( @(z)load(z).CRF, Files ); for f=string(fieldnames(S))' w...

3 years ago | 0

Answered
transform an empty matrix '0x0 double' into a matrix '0x1 uint8'
x=zeros(0,0); y=uint8( reshape(x,0,1) ); whos x y

3 years ago | 1

Answered
How can i find inside area of the geometry (2d) ??
Area = polyarea([x1;x2],[y1;y2])

3 years ago | 1

| accepted

Answered
How to fit an equation (catenary equation in 2D) to a 3D dataset (experimental data of a catenary curve in 3D) ?
In the Examples tab of this FEX page, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for-fitt...

3 years ago | 1

Answered
Uable to call the solutions in a system of linear equation
clear; a = sym('a',[1 5]) b = sym('b',[1 5]) ... Sol0 = vpa(S.b1) Sol1 = vpa(S.b2) Sol2 = vpa(S.b3) Sol3 = vpa(S....

3 years ago | 0

Answered
Calculating the sum of squared within cluster distances
The method you've posted is highly inefficient. You should just do, Dk=2*width(cluster)*(norm(cluster-mean(cluster,2),'fro')^2 ...

3 years ago | 1

| accepted

Answered
How to sum two cells element by element?
One way, A={1,2}, B={10,20}, C=cellfun(@plus, A,B,'uni',0)

3 years ago | 0

| accepted

Answered
Nlinfit error (jacobian's column are zero)
The best trouble shooting approach would be to first obtain the Jacobian at the solution by calling nlinfit with more output arg...

3 years ago | 0

| accepted

Answered
How do I prompt user to re-input value if first attempt is incorrect?
Something like this, perhaps? exit=false; msg='Please enter an R^2 value for Cement: ' while ~exit data = str2double( i...

3 years ago | 0

| accepted

Answered
Simultaneously fitting two non-linear equations with shared model coefficients
Since the error message is complaining about the initial point, you should check the value of modelfunc() at the initial point. ...

3 years ago | 0

Answered
How do I locate the most repeated elements in an array/vector?
Using this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetition...

3 years ago | 0

Answered
How to perform mathematical operation of arrays inside loop?
for i=1:N E=B-A*X; if norm(E,1)<1e-40, continue; end C=E.^2; X=lscov(A,B,1./C); end...

3 years ago | 1

Answered
Why there is a large numerical error in simple arithmatics?
You need to look at the relative errors. You will see that they are super-small: x = rand(1,1); x_1000 = x*1000; N = -20 : ...

3 years ago | 0

Answered
fsolve no solution found results
Is the output the last iteration or does it output the initial conditions? It is the last iteration, as you can easily test, .e...

3 years ago | 0

| accepted

Answered
fmincon sometimes returns "incorrect number of elements of objective gradient" error.
My best guess is that the MaxFunctionEvaluations limit was reached midway through finite differencing operations needed to compl...

3 years ago | 0

Answered
non linear regression problem. fitnlm gives error
Your model function can easily generate NaN's and Infs because with fitnlm there is nothing to bound the b parameters (see below...

3 years ago | 0

Answered
Defining normal unit vector for arbitrary plane surface in 3D space
Use planarFit() in this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for-fitt...

3 years ago | 0

Answered
How can i get the smallest shape using a list of centroid coordinates?
You can use bwalphaclose from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/90762-further-tools-for-a...

3 years ago | 0

| accepted

Answered
Plotting the vertex based hexagon hierarchical structure.
P=rotate(nsidedpoly(6,'SideLength',1),30); %1 hexagon plot(P,'FaceColor','none'); axis equal P=fcopy(P,sqrt(3)*[1,0], 0:7 ...

3 years ago | 0

Answered
Creating 3D efficiency map using interpolation.
torque=torgue; F=scatteredInterpolant(speed(:),torque(:), efficiency(:)) Now use F to query the points you want as explained...

3 years ago | 1

Answered
Finding a set of easily distinguishable local minima quickly and algorithmically.
load matlab y=im_mean(:); x=(1:numel(y)).'; k=(y==movmin(y,21)); plot(x,y,'-', x(k),y(k),'ro'); legend('Signal','Local...

3 years ago | 0

Answered
How to plot an in-ellipse(ellipse inside an object) which also matches the object orientation.
a=5; b=3; %axes lengths theta=40; %rotation angle x0=1;y0=2; %center fcn=@(p) translate( rotate( scale(p,[a,b]), theta),...

3 years ago | 1

| accepted

Answered
Trouble using Curve Fitter tool
I am not sure I understand what you mean regarding apparent singularities in my x,y data. If beta+k2*x=0 or delta+k4*x=0 then y...

3 years ago | 0

Answered
fmincon non-linear optimisation: issues with sqp and interior-point
SQP...Basically, it lacks the tools to make a step back when overshoots On the contrary, it is one of the few algorithms that c...

3 years ago | 0

| accepted

Answered
How to find the value in one column based on a value of a another column.
% Generate example data time = (0:0.1:1)'; pressureA = 20*sin(time/3); pressureB = 20*sin(pi*time/4); pressureC = 20*sin(p...

3 years ago | 0

Load more