Answered

How to accurately find angle between these two vectors ? (Data Provided).

I don't know what your ultimate purpose is with this rotation you are trying to perform. If the goal is to make the two loci ove...

How to accurately find angle between these two vectors ? (Data Provided).

I don't know what your ultimate purpose is with this rotation you are trying to perform. If the goal is to make the two loci ove...

9 days ago | 1

Answered

Matlab help is not working

Make sure that you are not overriding any functions called by help.m with mfiles of your own. For example, if you have your own ...

Matlab help is not working

Make sure that you are not overriding any functions called by help.m with mfiles of your own. For example, if you have your own ...

9 days ago | 0

Answered

Index in position 1 exceeds array bounds (must not exceed 2).

How can To(t,1) make sense when t becomes greater than 2? To is only a length 2 vector.

Index in position 1 exceeds array bounds (must not exceed 2).

How can To(t,1) make sense when t becomes greater than 2? To is only a length 2 vector.

9 days ago | 0

Answered

finding the distance between points of boundaries

If you have the Statistics Toolbox, you can pdist2 https://www.mathworks.com/help/stats/pdist2.html D = pdist2(Red,Green)

finding the distance between points of boundaries

If you have the Statistics Toolbox, you can pdist2 https://www.mathworks.com/help/stats/pdist2.html D = pdist2(Red,Green)

9 days ago | 0

Answered

How to accurately find angle between these two vectors ? (Data Provided).

function [theta, Nrm]=vecrot(vstart,vend) %Find rotation carrying one vector toward another about their common perpendicular ...

How to accurately find angle between these two vectors ? (Data Provided).

function [theta, Nrm]=vecrot(vstart,vend) %Find rotation carrying one vector toward another about their common perpendicular ...

9 days ago | 0

| accepted

Answered

How can one create this matrix, part 3

[X, Y, Z] = ndgrid( 1:.1:1.5., 0:.1:0.5, 0:.1:0.5); [Z(:), Y(:), X(:)]

How can one create this matrix, part 3

[X, Y, Z] = ndgrid( 1:.1:1.5., 0:.1:0.5, 0:.1:0.5); [Z(:), Y(:), X(:)]

9 days ago | 0

| accepted

Answered

How to find a specific value from a matrix having columns within columns

You haven't mentioned in what form you are holding this data, but my recommendation would be to hold it as a 3x4x5 matrix, A. Th...

How to find a specific value from a matrix having columns within columns

You haven't mentioned in what form you are holding this data, but my recommendation would be to hold it as a 3x4x5 matrix, A. Th...

9 days ago | 0

| accepted

Answered

Image denoising using uniform cubic b spline

Have you tried csaps? https://www.mathworks.com/help/curvefit/csaps.html

Image denoising using uniform cubic b spline

Have you tried csaps? https://www.mathworks.com/help/curvefit/csaps.html

9 days ago | 0

Answered

How do I create a sliding window and/or bin that records the number of elements over a given time period

t1 = 20; %start time, seconds t2 = 30; %end time, seconds win=tim_trl>=t1 & tim_trl<=t2; time = tim_trl(win); %10s window ...

How do I create a sliding window and/or bin that records the number of elements over a given time period

t1 = 20; %start time, seconds t2 = 30; %end time, seconds win=tim_trl>=t1 & tim_trl<=t2; time = tim_trl(win); %10s window ...

9 days ago | 0

| accepted

Answered

Linear Constraint Fmincon Function Form

I have currently created a nonlcon function for it but it is linear so I don't know the effect of doing this? There's nothing ...

Linear Constraint Fmincon Function Form

I have currently created a nonlcon function for it but it is linear so I don't know the effect of doing this? There's nothing ...

10 days ago | 0

Answered

How to calculate mean in moving cubic volume?

I know I need to use mat2cell and mean function. I don't think you do. Let's call your 3D volume, V: [ci,cj,ck]=deal(51,51,251...

How to calculate mean in moving cubic volume?

I know I need to use mat2cell and mean function. I don't think you do. Let's call your 3D volume, V: [ci,cj,ck]=deal(51,51,251...

10 days ago | 0

| accepted

Answered

I'm looking if there anyone can share with me the code of optimization with multi-objective?

The best place to look for shared code is on the File Exchange. I see there is at least one MPSO offering here, https://www.mat...

I'm looking if there anyone can share with me the code of optimization with multi-objective?

The best place to look for shared code is on the File Exchange. I see there is at least one MPSO offering here, https://www.mat...

10 days ago | 0

Answered

How to know the current input for fminsearch?

You can use an OutputFcn, https://www.mathworks.com/help/matlab/math/output-functions.html#bsgue2z or simply add a line of cod...

How to know the current input for fminsearch?

You can use an OutputFcn, https://www.mathworks.com/help/matlab/math/output-functions.html#bsgue2z or simply add a line of cod...

10 days ago | 1

| accepted

Answered

K-th order neighbors in graph

function result=distk(G,i,k) % G -graph % i - start node % k - number of steps A=adjacency(G); v=A(i,:); ...

K-th order neighbors in graph

function result=distk(G,i,k) % G -graph % i - start node % k - number of steps A=adjacency(G); v=A(i,:); ...

11 days ago | 1

| accepted

Answered

Smooth derivative of a matrix

So my question is: is there any way to smoothly connect the eigenvectors of neighbouring k points? Not in general. The eigenvec...

Smooth derivative of a matrix

So my question is: is there any way to smoothly connect the eigenvectors of neighbouring k points? Not in general. The eigenvec...

11 days ago | 0

Answered

Second order polynomial curve of best fit

It probably happens because you've chosen too arbitrary an initial guess constant=[0;0;0]. It's clear from your data that these ...

Second order polynomial curve of best fit

It probably happens because you've chosen too arbitrary an initial guess constant=[0;0;0]. It's clear from your data that these ...

11 days ago | 0

| accepted

Answered

Error - Failure in initial objective function evaluation. FSOLVE cannot continue.

Second, I'm not sure why fsolve is having trouble parsing the initial guess. This is not a separate error. fsolve is simply te...

Error - Failure in initial objective function evaluation. FSOLVE cannot continue.

Second, I'm not sure why fsolve is having trouble parsing the initial guess. This is not a separate error. fsolve is simply te...

12 days ago | 1

| accepted

Answered

can matlab find the row space and null space of a matrix?

Yes, the solution could involve the commands orth() and null().

can matlab find the row space and null space of a matrix?

Yes, the solution could involve the commands orth() and null().

12 days ago | 0

Answered

Subfunctions in optimization objective function

fmincon does not know or care about the internals of your objective function code. You can do anything there, and call whatever ...

Subfunctions in optimization objective function

fmincon does not know or care about the internals of your objective function code. You can do anything there, and call whatever ...

12 days ago | 1

| accepted

Answered

Getting meshgrid along different angles for data extraction from a matrix/image?

If you're just trying to generate shaded polygons, it would be simpler just to use impoly, e.g., x0 = 1; y0=1; x1 = 200; y1=50...

Getting meshgrid along different angles for data extraction from a matrix/image?

If you're just trying to generate shaded polygons, it would be simpler just to use impoly, e.g., x0 = 1; y0=1; x1 = 200; y1=50...

12 days ago | 0

| accepted

Answered

How can I remove the lines that are not in the cross section of the annulus?

figure(1); % add lj line to temperature profile hold on; for ii...

How can I remove the lines that are not in the cross section of the annulus?

figure(1); % add lj line to temperature profile hold on; for ii...

13 days ago | 2

| accepted

Answered

How to construct all possible combinations of points in N-dimensional space

X=[x1,x2,x3].'; Y=[y1,y2,y3].'; [I,J]=ndgrid(1:3,4*(0:N-1) ); P=[X(I(:)),Y(I(:)), J(:)]; d=pdist2(P,P);

How to construct all possible combinations of points in N-dimensional space

X=[x1,x2,x3].'; Y=[y1,y2,y3].'; [I,J]=ndgrid(1:3,4*(0:N-1) ); P=[X(I(:)),Y(I(:)), J(:)]; d=pdist2(P,P);

13 days ago | 0

Answered

how to draw the intersection of 3 3d objects?

One of these FEX submissions might be helpful, https://www.mathworks.com/matlabcentral/fileexchange/48613-surface-intersection ...

how to draw the intersection of 3 3d objects?

One of these FEX submissions might be helpful, https://www.mathworks.com/matlabcentral/fileexchange/48613-surface-intersection ...

13 days ago | 0

| accepted

Answered

How to check if object's property is read-only.

You can obtain that information from a metaclass object for the class, https://www.mathworks.com/help/matlab/matlab_oop/using-c...

How to check if object's property is read-only.

You can obtain that information from a metaclass object for the class, https://www.mathworks.com/help/matlab/matlab_oop/using-c...

13 days ago | 0

| accepted

Answered

Comparing elements in a 2d array

>> peak = [0, diff(array(1:end-1))>=0 & diff(array(2:end))<=0 , 0] peak = 0 1 0 0 0 1 0 >>...

Comparing elements in a 2d array

>> peak = [0, diff(array(1:end-1))>=0 & diff(array(2:end))<=0 , 0] peak = 0 1 0 0 0 1 0 >>...

13 days ago | 0

Answered

Improving and Optimizing Blurring Function

Using sepblockfun from the File Exchange, https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-opera...

Improving and Optimizing Blurring Function

Using sepblockfun from the File Exchange, https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-opera...

13 days ago | 1

| accepted

Answered

Nonlinear equation numerical solution

I tryed also with functions: fsolve, roots and find but were all unsuccessful. fsolve is overkill for such a simple 1D problem....

Nonlinear equation numerical solution

I tryed also with functions: fsolve, roots and find but were all unsuccessful. fsolve is overkill for such a simple 1D problem....

14 days ago | 1

Answered

How to find out zeros and their indices in a matrix?

One way is to use this FEX submission, https://www.mathworks.com/matlabcentral/fileexchange/78008-group1s H=group1s(~input(2,:...

How to find out zeros and their indices in a matrix?

One way is to use this FEX submission, https://www.mathworks.com/matlabcentral/fileexchange/78008-group1s H=group1s(~input(2,:...

14 days ago | 2

Answered

Is there a way to do these matrix vector multiplications without loops?

First, you would choose a different ordering. Instead of A = rand(m,n,4,4); v = rand(m,n,4); you would have A = rand(4,4,m,...

Is there a way to do these matrix vector multiplications without loops?

First, you would choose a different ordering. Instead of A = rand(m,n,4,4); v = rand(m,n,4); you would have A = rand(4,4,m,...

14 days ago | 1

| accepted

Answered

Optimizing systems of non-linear equation using optimvar and lsqcurvefit

Avoid sqrt so as to ensure fun is differentiable fun = @(x,xdata) [((1+4.*xdata.^2.*x(1)^2).^(-2) + x(4))./((1+4.*xdata.^2.*x(2...

Optimizing systems of non-linear equation using optimvar and lsqcurvefit

Avoid sqrt so as to ensure fun is differentiable fun = @(x,xdata) [((1+4.*xdata.^2.*x(1)^2).^(-2) + x(4))./((1+4.*xdata.^2.*x(2...

15 days ago | 0