Answered
Sort coordinates in two directions at the same time
It's not possible to sort so that the Nx2 matrix [lat(:),lon(:)] increases monotonically in both columns simultaneously, but yo...

3 years ago | 0

Answered
,v1Trying to solve a linear equation matrix with a log of X1-X5 in the matrix. Not sure how to use the log value in simulate to get correct result.
Make the change of variables z(i)=log(X(i)). Then use lsqminnorm to solve the linear equations in v(i) and z(i). You can then ex...

3 years ago | 0

Answered
Blocked images larger than a certain size will not render in Image Labeler
my understanding has been that it automatically sets the block size based on the size of the image and maybe the zoom level Per...

3 years ago | 0

Answered
calling unique function on a string column of a table failed
Why not as in the example below? T=table(["a";"b"; "a"],'Var',"C") [v,u]=unique(T.C)

3 years ago | 0

| accepted

Answered
trying to plot fminsearch as a polynomial
fplot( @(year) A6(1)* exp(A6(2)* year) + A6(3) )

3 years ago | 0

Answered
Image Processing - Absolute sum of the differences employing a weighted kernel
There are problems with the mathematical formulation, as noted in the comments above. However, for the general task of computing...

3 years ago | 0

| accepted

Answered
Blocked images larger than a certain size will not render in Image Labeler
I could of course break the images up into smaller images but that would make my workflow less efficient Breaking them up for t...

3 years ago | 0

Answered
Generalized equation using multiple equation
You can use lsqcurvefit with model function, xdata = [0.25 0.50 0.75 1 1.25 1.50 1.75 2 2.25 2.50 2.75 3]; y1 = [0.001524 0.0...

3 years ago | 0

| accepted

Answered
intersection between a many plots and a line
You could use linexlines2D from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/93470-intersections-of-...

3 years ago | 0

Answered
using a matrix in a calculation
Use element-wise operators .*, ./, and .^

3 years ago | 0

Answered
Interpolate Nan values in timetable
You could use movmean, like in this example, https://www.mathworks.com/help/matlab/ref/movmean.html#bu6jxup

3 years ago | 0

Answered
Problem: Image segmentation of forest area using CNN and MATLAB's BLOCKPROC function.
I would implement fun as a non-anonymous function. Then, you can stop inside the function and inspect the result: C = blockproc...

3 years ago | 0

Answered
Vectorised form and inverse of matrix
The vectorised form I wrote to reduce time looks like this: You should be able to see if it's correct by comparing hte output o...

3 years ago | 0

Answered
[Optimization] fmincon not respecting nonlinear constraints
The maths is irrelevant. In short, the nonlinear constraint function takes the program variable vector P, does some nonlinear st...

3 years ago | 0

Answered
How can I colour data points based on 3 inputs?
Since you don't seem to want a connecting line in your data points (LineStyle='none'), a scatter plot would probably be more app...

3 years ago | 0

Answered
Applying Quantization Matrix in which specific coefficients are zero'd out
One way would be to set Q_matrix to twice the maximum of blocks_dct. That will ensure that the floor() operation zeros them. A...

3 years ago | 0

| accepted

Answered
If I have tow arrays and I want to find the max value in these two arrays with eachother how I can find that
f=@(u) -( cos(n).*sin(u)+sin(f).*cos(u) ); u0=linspace(0,2*pi,1e5); [~,i]=min(f(u0)); umax = fminsearch(f,u0(i)) %the r...

3 years ago | 0

Answered
adding a zero element in a specific location in array (between two elements)
C=A; C(logical(A))=B; %C is the result

3 years ago | 0

Answered
Optimizing a function for a given set of data
The function is a first order polynomial in . You can use roots to find where f()=0, or just solve by hand.

3 years ago | 0

Answered
3d Curve for 3 vectors
Data=[x(:).';y(:).';z(:).']; w=width(Data); XYZ=num2cell(spline(1:w,Data,linspace(1,w,10*w)),2); plot3(XYZ{:});

3 years ago | 0

Answered
Intersection of two vector lines
where a,b and s is a 3x1 matrix? I assume you really mean that a,b,u,c,d,v are 3x1 and t,s are scalars. ts=[b,-d]\( v-u ); ...

3 years ago | 0

| accepted

Answered
trivial matrix question: how to rearrange matrices in a given order
You can use blkColon in this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/115340-block-transposition-perm...

3 years ago | 0

| accepted

Answered
Trying to find error value in FFT compuation
It's very simple. This line has nothing to the right of the '=' sign. errYYinv = ;

3 years ago | 0

Answered
Summing array elements seems to be slow on GPU
So it looks like the summation is the most time-consuming operation on GPU. Is that an expected result? That's what I would ex...

3 years ago | 0

Answered
Graphing an array so the largest row graphs first and then so forth
IMHO, it's better just to assign distinct markers: x=[1,8,15,NaN,NaN; 1,8,15,22,29; 1,8,15,22,NaN]; y=[0,0,0,NaN,NaN; 0,0,0,2,...

3 years ago | 1

Answered
How to evaluate 3D spline at given z points?
[x,y,z]=deal(x(:),y(:),z(:)); %ensure column vectors zyx=num2cell( sortrows([z,x,y],1) ,1);%sort according to z [z,y,x]=de...

3 years ago | 0

Answered
Channel-wise convolution deep learning layer for 1d and 3d data i.e. groupedConvolution1dLayer, groupedConvolution3dLayer
A 1D image is a special case of a 2D image, so you should be able to use groupedConvolution2dLayers for the 1D case.

3 years ago | 1

| accepted

Answered
How to create stacked bar plot where each stack is of equal height and filled partially to user desired value ?
height=1; y=rand(4,1); B=bar([y,height-y],'stacked'); axis padded B(2).FaceColor='none';

3 years ago | 0

| accepted

Answered
Inconsistent training loss curve when training UNet with and without convergence criterion
There should be a change in the training loss curve - it should be shorter. By loosening the stopping criteria, you cause fewer ...

3 years ago | 0

Answered
Initializing arrays of objects with distinct handle properties
You can also rewrite the Junk1() constructor to generate array-valued output: classdef Junk1 < handle properties(GetAccess...

3 years ago | 0

| accepted

Load more