Answered
Area of contor from Matrix
Use scatteredInterpolant to resample the data on a grid, S=scatteredInterpolant(x,y,F); xg=linspace(min(x),max(x),500); yg=...

3 years ago | 0

| accepted

Answered
lsqnonlin: CheckGradients fails after multilying Jacobian with diagonal scaling matrix
%J=d(D*r)/darams = D*dr/dparams = D*J, right? No, it doesn't work because D=1/max(f) is not a constant. It depends on the un...

3 years ago | 0

| accepted

Answered
Create a function handle that is a sum of function handles
error=@(R) abs( vecnorm(POINTS-R) - R );

3 years ago | 1

Answered
Disable the gpu.
Matlab will use the CPU by default unless you have in some way told it to use the GPU for a specific computation. An exception...

3 years ago | 0

Answered
Constructor doesn`t work at all (Error using implicit default value of property in class)
Your posted code produces an error, but not the one you claim. You've misspelled the "Access" attribute, but once that is fixed ...

3 years ago | 0

| accepted

Answered
Multiplication of matrix and first dimension of a 3-D array without for loops
C=reshape( A*B(:,:) , size(B));

3 years ago | 1

Answered
Determine which string in an array matched using contains()
Easiest thing would be to just loop over the shorter of the two arrays, probably the pattern array: stringArray=stringArray(:);...

3 years ago | 1

| accepted

Answered
Multiply structure by a constant
s.a=1; s.b=2, S=structfun(@(f)10*f,s,'uni',0) %multiply by 10

3 years ago | 1

Answered
When using transposedConv2dLayer, how do you calculate the size of the output given an input?
I believe it would be newsize = [stride.*[a-1,b-1] + filtersize - 2*crop, numFilters]

3 years ago | 1

| accepted

Answered
how to plot exponential function
x = linspace(10^-12,50,100); y = (x ./ 0.026^2) .* (exp(-x ./ 0.026)); loglog(x, y,'x--')

3 years ago | 0

Answered
How to find the vector b if we know the RMSE?
That's not possible. You have, in this case, 6 unknowns but only 1 equation.

3 years ago | 0

Answered
Logical indexing returns different dimensions
Vectors have different indexing behavior than matrices. There's nothing more to it, except perhaps to point out that it's not ju...

3 years ago | 0

| accepted

Answered
A simultaneous linear equation with coefficients as variables
If the equations are, A*X=B then the roles of A and X are interchangeable and you can solve for A by doing, A=B/X Note, howe...

3 years ago | 0

| accepted

Answered
Find gradient of objective function for fmincon
Perhaps as follows. Note my restructuring of your array into an Nx2x2 form. function [f,gradf] = objfun(X,XQ,YQ,cdf1,cdf2) [...

3 years ago | 0

| accepted

Answered
How to interpolate between values in columns of an array without a for loop
You should use interp1. It's very straightforward. [m,n]=deal(8,5); x=(1:n)'; y=reshape(1:m*n,n,m) yq=interp1(x,y,[1.5;2...

3 years ago | 0

| accepted

Answered
How to find Fourier series for the periodic function?
You can use fourier, e.g. syms x n T f=rectangularPulse(x); series = simplify( fourier(f,2*pi*n/T)/T )

3 years ago | 0

| accepted

Answered
GPU support for besselh
Most of the bessel functions are supported by gpu but besselh is not. Am I wrong? If "supported by GPU" means does it accepts g...

3 years ago | 0

| accepted

Answered
Plotting 3 dimensional matrix data
Perhaps use contour3 or volshow.

3 years ago | 0

| accepted

Answered
How to get 2D plot using three arrays?
Are you sure you don't just want a surf plot? load Data surf(depth_1, t, AA_1'); xlabel Depth; ylabel t; zlabel Amplitude If...

3 years ago | 0

| accepted

Answered
nxm matrix function with zeros and ones
Hint: x=[1 0 1 0 1]; y=[ 0 1 0 1 0 1]; abs(x-y')

3 years ago | 1

| accepted

Answered
How to obtain nearest distance between two sets of coordinates
startpose = [2,1; 4,5; 6,5; 2,3; 8,9]; endpose = [7,6; 2,4; 5,4; 2,9; 1,6;]; [distance, index]=pdist2(startpose,endpose,'euc...

3 years ago | 0

Answered
maximization nonlinear problem and local maximum solution
It is pretty clear from the surface plot that, with the constraints you have, the solution you have found is indeed the global ...

3 years ago | 0

| accepted

Answered
how do I draw discriminatory lines in an image to calculate the area in each of those regions?
I was wondering how do i draw circular lines You can use drawcircle. More generally, you can segment interactively with the S...

3 years ago | 1

Answered
Accuracy problems using mldivide on GPU
Confirmed. But it doesn't seem to be mldivide that's the problem per se, but rather pagefun: load data for k = length(A):-1:...

3 years ago | 1

| accepted

Answered
Failure in initial objective function evaluation. FMINCON cannot continue in s function
Both your objective function and constraints are linear, so you should be using linprog. In fact, you nonlinear constraints are ...

3 years ago | 0

| accepted

Answered
Optimization: Unable to perform assignment because value of type 'optim.problemdef.OptimizationExpression' is not convertible to 'double'.
Here's a way to express the constraints linearly: Dij=rand(5); D=1; %hypothetical input data ns = size(Dij,1); ...

3 years ago | 0

Answered
Compute error between two graphs, each graph contains point data forming multiple curves.
You can use pdist2, Error=vecnorm( pdist2([x1,y1] ,[x2,y2],'euc','Smallest',1) )

3 years ago | 0

Answered
How to optimize a system with 5 optimization variables, 4 of them are in the objective function and the 5th is in the constriants?
If you are using the Solver-Based framework, you must pass all the unknowns both to the objective and constraints as a vector p=...

3 years ago | 0

| accepted

Answered
Finding values of implicit function of three dimension
b=10; v=70; ux=90; e=exp(1); EQN = @(t,x,u)(b.^u.*(ux./e.*u).^(v*t/2)-b.^(x/2)); fimplicit3(EQN); xlabel t; ylabel x; zla...

3 years ago | 0

Answered
3d matrix to 2d matrix
I think i have to use the reshape with permute function but i didnt quite get the correct syntax to ordinate properly the output...

3 years ago | 1

| accepted

Load more