Answered

How do a cell2mat conversion for a non-uniform cell to a matrix

cell2mat(DD(:))

How do a cell2mat conversion for a non-uniform cell to a matrix

cell2mat(DD(:))

7 giorni ago | 0

Answered

How to make a variable negative if another variable is negative?

X1=X.*sign(Y);

How to make a variable negative if another variable is negative?

X1=X.*sign(Y);

7 giorni ago | 0

| accepted

Answered

Intersection of two lines

You need a least squares solution, since lines in 3D do not generally intersect. Assuming your point data are in column-vector f...

Intersection of two lines

You need a least squares solution, since lines in 3D do not generally intersect. Assuming your point data are in column-vector f...

7 giorni ago | 0

| accepted

Answered

Plotting the solutions of an equation (rotated ellipsoid)

If you have the center, radii, and yaw-pitch-roll angles (in degrees) of the ellipsoid, you can plot a data-free ellipsoidalFit ...

Plotting the solutions of an equation (rotated ellipsoid)

If you have the center, radii, and yaw-pitch-roll angles (in degrees) of the ellipsoid, you can plot a data-free ellipsoidalFit ...

7 giorni ago | 1

Answered

Create a 2x3 matrix named mat_B from the first and 2nd rows, and the 2nd, 3rd and 4th columns of the matrix C.

Looks right to me.

Create a 2x3 matrix named mat_B from the first and 2nd rows, and the 2nd, 3rd and 4th columns of the matrix C.

Looks right to me.

8 giorni ago | 0

| accepted

Answered

I dont understand why my table is displaying 1x1 sym and not a numerical value

You seem to be under the impression that vpa() converts a sym to a number. What you really want to do is use matlabFunction() to...

I dont understand why my table is displaying 1x1 sym and not a numerical value

You seem to be under the impression that vpa() converts a sym to a number. What you really want to do is use matlabFunction() to...

8 giorni ago | 0

| accepted

Answered

How can I create a set of N diagnal matrices range from diag(1, 1, ... , 1) to diag(-1, -1, ... , -1) for testing purposes?

Do you really need all Z{i} at the same time? [C{1:N}]=ndgrid([-1,1]); C=reshape( cat(N+1,C{:}) ,[],N); Z=zeros(N^2,2^N); ...

How can I create a set of N diagnal matrices range from diag(1, 1, ... , 1) to diag(-1, -1, ... , -1) for testing purposes?

Do you really need all Z{i} at the same time? [C{1:N}]=ndgrid([-1,1]); C=reshape( cat(N+1,C{:}) ,[],N); Z=zeros(N^2,2^N); ...

8 giorni ago | 1

| accepted

Answered

Non-linear constraints with several input variables in fmincon

Your nonlinear constraints are not differentiable. That doesn't always spell disaster, but it breaks the assumptions of fmincon....

Non-linear constraints with several input variables in fmincon

Your nonlinear constraints are not differentiable. That doesn't always spell disaster, but it breaks the assumptions of fmincon....

8 giorni ago | 0

| accepted

Answered

fsolve, fmincon producing different results

Do they both achieve the same objective value? If so, you simply have multiple solutions.

fsolve, fmincon producing different results

Do they both achieve the same objective value? If so, you simply have multiple solutions.

8 giorni ago | 0

Answered

How to extract columns from multiple 3D arrays?

Seems like you could just put them in a matrix: F=[f1(:), f2(:),f3(:),...,f7(:)]

How to extract columns from multiple 3D arrays?

Seems like you could just put them in a matrix: F=[f1(:), f2(:),f3(:),...,f7(:)]

8 giorni ago | 0

| accepted

Answered

How to Solve matrix equations in Matlab

With an over-determined system (3 equations and only 2 unknowns), you can't expect an exact solution. However, the solution that...

How to Solve matrix equations in Matlab

With an over-determined system (3 equations and only 2 unknowns), you can't expect an exact solution. However, the solution that...

8 giorni ago | 1

| accepted

Answered

Efficiently assigning class property in a quadruple loop?

You've not told us the dependence of myLogicalVector and someFixedValue* on the loop variables, which is probably super-importa...

Efficiently assigning class property in a quadruple loop?

You've not told us the dependence of myLogicalVector and someFixedValue* on the loop variables, which is probably super-importa...

10 giorni ago | 0

Answered

Double Summation without using fft2 function

You can find examples of for-loop construction here, https://www.mathworks.com/help/matlab/ref/for.html#buhafgy-3

Double Summation without using fft2 function

You can find examples of for-loop construction here, https://www.mathworks.com/help/matlab/ref/for.html#buhafgy-3

10 giorni ago | 0

| accepted

Answered

Sequence 1, 2, 4, 12

One possibility: p=[0.833333333333333 -4.499999999999996 8.666666666666661 -3.999999999999996]; polyval(p,1:4) polyval(...

Sequence 1, 2, 4, 12

One possibility: p=[0.833333333333333 -4.499999999999996 8.666666666666661 -3.999999999999996]; polyval(p,1:4) polyval(...

11 giorni ago | 0

Answered

How to get optimal linear scaling factor for a set of vectors

I want to determine a linear scale factor for each y_raw? vector, such that the mean squared error (MSE) between the average of ...

How to get optimal linear scaling factor for a set of vectors

I want to determine a linear scale factor for each y_raw? vector, such that the mean squared error (MSE) between the average of ...

11 giorni ago | 0

| accepted

Answered

Linear Equations infinite solutions parametric form

x0=pinv(A)*b; B=null(A); sol=@(c)x0+B*c;

Linear Equations infinite solutions parametric form

x0=pinv(A)*b; B=null(A); sol=@(c)x0+B*c;

11 giorni ago | 1

| accepted

Submitted

Further tools for analyzing objects in N-dimensional images

A collection of tools to supplement bwpropfilt, bwareaopen, and the like.

11 giorni ago | 6 downloads |

Answered

How can I speed up (or avoid) a comparison in for loop?

You might try bwlareaopenn from this submission https://www.mathworks.com/matlabcentral/fileexchange/90762-further-tools-for-an...

How can I speed up (or avoid) a comparison in for loop?

You might try bwlareaopenn from this submission https://www.mathworks.com/matlabcentral/fileexchange/90762-further-tools-for-an...

11 giorni ago | 1

Answered

Solver based optimization passing extra parameters

nonlcon=@(x)constraintFcn(x,aa) See also, Passing Extra Parameters - MATLAB & Simulink

Solver based optimization passing extra parameters

nonlcon=@(x)constraintFcn(x,aa) See also, Passing Extra Parameters - MATLAB & Simulink

11 giorni ago | 0

Answered

How to get the file names that start with the same letter in the folder?

For example, s=dir('T*_imag.bin'); fileNames={s([s.isdir]==0).name}

How to get the file names that start with the same letter in the folder?

For example, s=dir('T*_imag.bin'); fileNames={s([s.isdir]==0).name}

11 giorni ago | 0

Answered

Matrix form for creation and annihilation operator with spins.

Not sure this will help, but if you can write a function that implements the operator, then his File Exchange offering, https:/...

Matrix form for creation and annihilation operator with spins.

Not sure this will help, but if you can write a function that implements the operator, then his File Exchange offering, https:/...

11 giorni ago | 0

Answered

What should go in a next-generation MATLAB X?

My wish list: (1) Colon operator produces column vectors, not row vectors: x=1:4 (2) Optimization Toolbox solvers should ha...

What should go in a next-generation MATLAB X?

My wish list: (1) Colon operator produces column vectors, not row vectors: x=1:4 (2) Optimization Toolbox solvers should ha...

11 giorni ago | 2

Answered

combine different size vectors into one matrix

I will assume you have the vectors in a cell array C={[2 3 4 5]; [4 7 7]; [8 8 7 4 2 5]} Then, you can simply do, z=...

combine different size vectors into one matrix

I will assume you have the vectors in a cell array C={[2 3 4 5]; [4 7 7]; [8 8 7 4 2 5]} Then, you can simply do, z=...

11 giorni ago | 0

Answered

using fsolve function to solve for 2 unknowns

x0 = [80,110]; [sol, Fsol] = fsolve(@problem_one,x0), function F = problem_one(theta) theta3 = theta(1); theta4 ...

using fsolve function to solve for 2 unknowns

x0 = [80,110]; [sol, Fsol] = fsolve(@problem_one,x0), function F = problem_one(theta) theta3 = theta(1); theta4 ...

13 giorni ago | 1

| accepted

Answered

fminunc initial point is local minimum, but fminsearch returns reasonable estaimtes

It could happen if your objective function is piece-wise flat (and hence non-differentiable). fminsearch is a derivative-free so...

fminunc initial point is local minimum, but fminsearch returns reasonable estaimtes

It could happen if your objective function is piece-wise flat (and hence non-differentiable). fminsearch is a derivative-free so...

13 giorni ago | 0

| accepted

Answered

How can I obtain the Fourier Transformation as a product of matrices?

N = (0:255).'; X = (2*cos(((15.8*pi)/128)*N)) + (3*sin(((27.3*pi)/128)*N)); F=fft( eye(numel(X)), [],1); fX = fft(X); %...

How can I obtain the Fourier Transformation as a product of matrices?

N = (0:255).'; X = (2*cos(((15.8*pi)/128)*N)) + (3*sin(((27.3*pi)/128)*N)); F=fft( eye(numel(X)), [],1); fX = fft(X); %...

13 giorni ago | 0

| accepted

Answered

Solving non linear equation "Circle" equations

Because you cannot be certain of an exact 3-way (or n-way) intersection, you need to use a numerical least squares solver like f...

Solving non linear equation "Circle" equations

Because you cannot be certain of an exact 3-way (or n-way) intersection, you need to use a numerical least squares solver like f...

13 giorni ago | 1

| accepted

Answered

What is the real value of "single(my_variable)"?

So the C code keeps good precission. But, does Matlab? Yes, if by "good precision" you mean up to 7 digits. You can see that ev...

What is the real value of "single(my_variable)"?

So the C code keeps good precission. But, does Matlab? Yes, if by "good precision" you mean up to 7 digits. You can see that ev...

13 giorni ago | 0