Answered
Check if a point lies between two lines
Hint: Look at cart2pol.

3 years ago | 0

Answered
How to plot a function which takes 2 inputs and spit out a single output
trimesh is a possibility, T = delaunay(X1,X2); subplot(1,2,1) trimesh(T,X1,X2,Y1) subplot(1,2,2) trimesh(T,X1,X2,Y2)

3 years ago | 0

Answered
Deeplearning toolbox data input
but i cant use .mat as an input Yes, you can. imds = imageDatastore(location,"ReadFcn",@load); You also don't necessarily ne...

3 years ago | 0

| accepted

Answered
The explanation of each step in ellipse fitting code
I've added some comments. % Calculate centroid, orientation and major/minor axis length of the ellipse s = regionprops(BW,{'Ce...

3 years ago | 0

| accepted

Answered
How to fix the must be a column vector error?
You have not inspected what euler_eqns s returning. If you do, you will see that it is not a column vector.

3 years ago | 0

Answered
How to update certain cell values without using for loop
There is no way to iterate over cell or struct arrays, other than with an M-Coded for-loop, or something equivalent. The way to ...

3 years ago | 0

Answered
Problem with parfor loop due to some variable that cannot be classified.
It might be easier just to use for-drange loop. spmd counts=0; for i=drange(1:N) counts=counts+1; ...

3 years ago | 0

| accepted

Answered
Error on convolutional layer's: input data has 0 spatial dimensions and 0 temporal dimensions.
So far, I have only managed to work around the problem by reformulating the training inputs as 2D images of dimension 512x1: X_...

3 years ago | 0

Answered
I'm having trouble with convolution1dLayer
Tech Support has suggested 2 workarounds to me. The simplest IMO is to recast the training as a 2D image classification problem,...

3 years ago | 0

| accepted

Answered
curve fitting of two equation to two data sets simultaneously
lsqcurvefit will do it. x=x(:); G1=G1(:); G2=G2(:); %ensure column vectors I=logical(x); b0=mean(G1(I)./G2(I)./x(I)); %In...

3 years ago | 0

Answered
table from the variable from the loop
j=0; for w=W_takeoff:-50:W_landing j=j+1; V(j,1) = sqrt(2*w/rho/S/cl_max); D(j,1) = 0.5 * rho * V(j) * ...

3 years ago | 0

| accepted

Answered
How to concatenate an array?
dataTT=[]; while true dataTT = [dataTT, read(MQTTSignal)]; str = dataTT(end).Data; ... end

3 years ago | 0

| accepted

Answered
How to divide 256X256 matrix into sixteen 16X16 blocks?
You can download mat2tiles from, https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-...

3 years ago | 1

Answered
How to define a step in the design interval using an optimization algorithm?
You can constrain an optimization variable to integers with the intcon argument. Then, you can multiply this variable by some sc...

3 years ago | 0

| accepted

Answered
Nearest Points in a Point Cloud
See pdist2, knnsearch, and rangesearch.

3 years ago | 1

Answered
Con2vert with 5 dimensions Error: Arrays have incompatible sizes for this operation.
I recommend using lcon2vert instead, A = [0 1 0 1 1; 1 0 0 0 0; -1 -3 1 -3 0; 2 0 -1 3 -6; 0 -1 0 0 0; 0 0 -1 0 0; 0 0 0 -1 0; ...

3 years ago | 1

| accepted

Answered
Graphing several curves of a variable for various values of a parameter
%Plotting on command window BETAS=[0, 0.2, 0.4, 0.6, 0.8]; for i=1:numel(BETAS) beta=BETAS(i); [t,y] = ode23s(...

3 years ago | 1

| accepted

Answered
removing one-voxel bridges between clusters?
Perhaps using imopen?

3 years ago | 0

Answered
Improving efficiency and runtime to use a binary mask to sort another set of XY coordinates?
binaryMask = zeros(1868); %determine center of the circle and radius y_center = 921; x_center = 921; radius = 150; [xx, yy]...

3 years ago | 1

| accepted

Answered
I'd like to merge two different tables on matlab, how do I do that?
Time1 = ["t1";"t2";"t3"]; value1 = [374; 164; 476]; value2 = [2455;5478;2354]; value3 = [53782;35683;24682]; table1 = table(...

3 years ago | 0

| accepted

Answered
Faster way of appending data to large struct array
That is a quite a bit of data. Even in single precision, the array will consume ~3 GB. Ths should be faster, though. stats=nan(...

3 years ago | 0

| accepted

Answered
Constrained Optimization Problem With Obj Function Which Is Numerical Solution To A System Of ODE's
Perhaps you might use fmincon as follows: A=kron( eye(4) , ones(1,52)); b=[300;10;1;1]; %summation constraints Aeq=[]; beq=[];...

3 years ago | 0

Answered
Problem with nonlinear objective function
prob.Objective.OF2 = "max"; "max" is just a string. There is no optimization expression that can be interpreted from it.

3 years ago | 1

| accepted

Answered
Sum two matrices shifted by a non integer number?
Because of the linearity of interpolation, you should not interpolate each matrix. You should sum the matrices first, then inter...

3 years ago | 0

| accepted

Answered
Optimising my data importer for large datasets
I don't see any pre-allocation of udata. Also, nothing is being done with x, so it will cut down on time if you don't create it....

3 years ago | 0

Answered
Calculate 3D gradient of data corrisponding to a non-uniform grid
I would just compute the Jacobian matrix of the spherical to cartesian coordinate transformation and multiply the spherical grad...

3 years ago | 0

| accepted

Answered
Write the f(c) as an anonymous function
Is this correct? There is no need for abs(). Also, your division and exponentiation operations need to be element-wise, f = @...

3 years ago | 1

| accepted

Answered
3 subplots with the bottom one split in 2 vertically?
Is this what you mean? close all x = -10:0.01:10; y = cos(x); ax=subplot(2,2,[1,2]); axis square plot(x,y) ax.Position...

3 years ago | 0

Answered
Find the elements of array with the difference between one of the remaining elements less than specified
A=[1 18 25; 26 30 11; 5 31 20]; thresh=2; [m,n]=size(A); p=m*n; D=abs( A(:)-A(:)' ); D(1:p+1:end)=inf; [I,J]=find(resh...

3 years ago | 1

| accepted

Load more