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

Answered
Initializing arrays of objects with distinct handle properties
One way: x=arrayfun(@(z)Junk1,ones(3,1)) x.prop1 x = 3×1 Junk1 array with properties: prop1 prop2 an...

3 years ago | 0

Answered
How to smooth binary image
load BWImage; BW=(1-entropyfilt(BW,ones([11,5]))); BW=imclose(BW,ones([11,1])); BW=bwareaopen(BW>0.2,20); imshow(BW...

3 years ago | 0

| accepted

Answered
sort properties alphabetically in variable preview not working
You cannot change the order in which properties are displayed in the variable editor (other than to reverse it). If you want an ...

3 years ago | 0

Answered
How to compute shortest path in Graph ?
You can use the shortestpath command.

3 years ago | 0

Answered
Convert 4 numbers of 2D image frame to 3D
cat(3,im1,im2,im3,im4)

3 years ago | 0

Answered
Insufficient number of outputs from right hand side of equal sign to satisfy assignment.
Possibly, you've done something like this within the method() function: out={1,2}; [a,b,c]=out{:}

3 years ago | 0

Answered
How to find vector in array of vectors with the highest value of one component?
If I assume that p is an Nx4 array, then, [~,row]=max(p(:,2)); result=p(row,1:3)

3 years ago | 0

| accepted

Answered
fmincon optimization not running properly, stops beacuase of StepTolerance
It should give back 0.450; -0,005; -0,005. If you have that foreknowledge, you should apply lb and ub bounds as I have done bel...

3 years ago | 1

Answered
Interpolating Arrays to be Same Size
interp1(dP,linspace(1,numel(dP),numel(iP)))

3 years ago | 0

Answered
How to remove repeating entries from a vector?
You can use this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repe...

3 years ago | 0

Answered
Vectorization problem for grouping entries in an array
findgroups(B(:,2)<=1, B(:,3))

3 years ago | 0

Load more