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

Answered
how to plot multiple graphs with same x-axis and y-axis?
Using subaxis(), downloaded from here, https://www.mathworks.com/matlabcentral/fileexchange/3696-subaxis-subplot?s_tid=srchtitl...

3 years ago | 0

Answered
Fast way of computing all possible products of n matrices
Here's an alternative method that eliminates redundant computation, like you were hoping, using recursion. However, it doesn't s...

3 years ago | 1

Answered
How to count pixels/measure area in binary image?
Let's consider 3 regions B (the background, which you have as a binary image), C (the circles), and D (the connective arms betwe...

3 years ago | 1

Answered
how to avoid for loop to increase speed
And instead of the mean, I am interested in the mode. This method should offer speed-up for a generic function, provided that ...

3 years ago | 0

Answered
How to find the angle of object by using other function instead of using minFeretProperties because it is not supported for code generation.
Here is possibly another way to compute the MinFeretAngle, based on radon. According to the documentation, the Coder does suppor...

3 years ago | 0

Answered
How split an image into four parts?
Using mat2tiles from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-...

3 years ago | 1

Answered
Intersecting a point cloud and grids
It's a straightforward application of histcounts2.

3 years ago | 0

Answered
I am having an array with positive integers, and i want to know all the possibility that the sum of elements of the array is close to or equal to a number say (N))
N=40; A = [1 7 13 20 38 39 40]; A=unique(A); n=find(cumsum(A)<=N,1,'last'); result=cell(n,1); for i=1:n tmp=su...

3 years ago | 0

| accepted

Answered
Fast way of computing all possible products of n matrices
This solution (note the attachments) does it in about 1 sec for a 20x20x10 set of single float matrices. matrices=rand(20,20,10...

3 years ago | 3

| accepted

Load more