Answered
How do I do this summation equation in MATLAB
Looks like you could simply do it in one line with, eta=vecnorm(Y(:,1:N/2),2,2).^2/N ;

3 years ago | 0

| accepted

Answered
Shifting an array without circshift
circshift is not doing anymore than indexing into the array like below, so you could do that directly. x=1:10; xshift = x([e...

3 years ago | 0

Answered
How to save volshow(data,config) as fig or img [volumeViewer]?
See this related thread, https://www.mathworks.com/matlabcentral/answers/1960414-how-to-capture-the-view-in-volshow-as-an-image...

3 years ago | 1

Answered
Big struct variable to be shared by multiple functions/procedures. Global variable or not?
but I am wondering if this could be an exception I am not sure why you think it would be an exception. A big advantage of packi...

3 years ago | 0

Answered
There is a 1:1 mapping between the points in 2 separate 3D spaces. How do I pick a new point in one space and interpolate what the point will be in the other space?
If you have a parametric model for the 1-1 mapping, it might be a good idea to perform a fit to the model using e.g., lsqcurvefi...

3 years ago | 1

Answered
There is a 1:1 mapping between the points in 2 separate 3D spaces. How do I pick a new point in one space and interpolate what the point will be in the other space?
If your data is gridded, use griddedInterpolant. Otherwise, if it is scattered, use scatteredInterpolant. Since you are interpol...

3 years ago | 1

| accepted

Answered
Obtain Hessian matrix from a sum of squares expression
x=optimvar('x',[64,64]); Objective=0.0010309*x(11, 7)*x(13, 9) + 0.0016748*x(15, 11)*x(13, 9) + 0.0025*x(12, 7)*x(14, 9) + ...

3 years ago | 0

| accepted

Answered
How to find the maximum value of two variables of a function in MATLAB
Your function z is separable and monotonically decreasing in both variables. So, it should come as no surprise that the smallest...

3 years ago | 1

Question


Copy/paste over Remote Desktop
I often work on Matlab remotely using Windows' Remote Desktop. When doing so, I find that I can cut/copy items from Matlab's Cur...

3 years ago | 1 answer | 1

1

answer

Answered
Find locations of a value in 3-D matrix (lat x lon x time) and take the two time steps before and after those selected values
One way: sz=size(ls); [I,J,K]=ind2sub(sz, find(ls) ); A=precip(sub2ind(sz,I,J,K-2)); %2 hours before B=precip(sub2ind...

3 years ago | 0

Answered
Cell arrays with a vector within a cell within a cell
Maybe this is what you mean? C_in={[1;2;3],[4;5],6} n=max(cellfun('length',C_in)); C_out=num2cell(cell2mat( cellfun(@(x) ...

3 years ago | 0

| accepted

Answered
Cell arrays with a vector within a cell within a cell
Is this what you mean? C_in={{[1;2;3]},{[4;5]},{6}} C_out=[C_in{:}]

3 years ago | 0

Answered
my nonlinear constraints HAVE to be satisfied, what to do next?
(1) It is not possible to enforce equality constraints (e.g. Snell's Law) exactly , whether linear or non-linear. This is true b...

3 years ago | 0

| accepted

Answered
How to capture the view in volshow as an image?
There are programmatic ways to take a screenshot, e.g., https://www.mathworks.com/matlabcentral/fileexchange/24323-screencaptur...

3 years ago | 0

| accepted

Answered
trying to solve a system of 6 non linear equations to derive 6 unknown variables in terms of other known variables
It seems quite unlikely to me that the system has a symbolic solution.

3 years ago | 0

Answered
How to make a polyfit with constraints to the first and second derivative?
More often than not, if you have such constraints, it is spline that you want to fit, not a polynomial. Constrained spline fits ...

3 years ago | 1

| accepted

Answered
How to make a polyfit with constraints to the first and second derivative?
Well they are just linear constraints on the coefficients, so you could use lsqlin if you have the Optimization Toolbox.

3 years ago | 0

Answered
How to group a matrix based on one column?
Usually i use unique() function and then check if my rows matches with unique value rows, then i group by this using for loop. ...

3 years ago | 0

Answered
to find root of transcendental equation
As from below program i need to confirm The roots are α = {2.7859,5.5215,7.9573} If you only need to confirm the roots, just pl...

3 years ago | 0

Answered
How to find the angle?
One way: dPt=normalize(Point2-Point1,'n'); angle=acosd(dPt(1)) %degrees

3 years ago | 1

| accepted

Answered
Generate random numbers with specific mean
You can use this FEX download https://www.mathworks.com/matlabcentral/fileexchange/9700-random-vectors-with-fixed-sum?s_tid=src...

3 years ago | 0

| accepted

Answered
How to do activation quantization of EACH LAYER in lgraph or dlnetwork?
Have you seen this already? https://www.mathworks.com/help/deeplearning/quantization.html

3 years ago | 0

Answered
How do I solve this non linear equation that requires user defined inputs for each variable and determine the value of K
Alternatively, recognize that, r=(I-I0)/(Ilim-I0) is a solution of the quadratic equation, c0*r^2 - (c0+c+1/K)*r + c=0 This ...

3 years ago | 0

Answered
Using string() on double values without automatic rounding?
even when there are more decimals in the original double value There are no more decimals in the original double value. A doubl...

3 years ago | 0

| accepted

Answered
How to apply Gaussian blur to a specific area (oval) in an image?
1.Make a logical mask of the oval 2. Erode the mask by 1 pixel (imerode) 3. Use imgaussfilt to filter the whole image 4. Re...

3 years ago | 1

Answered
Deriving isolation ranges of roots of nonlinear equation
This FEX download might be helpful https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-...

3 years ago | 0

Answered
Compute Jacobian of a function using Automatic Differentiation
You can do so numerically using, for example, this: https://www.mathworks.com/matlabcentral/fileexchange/13490-adaptive-robust-...

3 years ago | 0

Answered
Zero out values in multiple fields of a struct
I would recommend a different data organization: S.Title = 'MyData'; S.Date = datetime('today'); S.ID=["ABC0500", "ABC0500", ...

3 years ago | 0

Answered
How to avoid linear indexing in operations involving matrices of different sizes
A = rand(3,3); B = rand(3,2); idx = logical([0 1 1; 0 1 1; 0 1 1]); C=B; C(:)=A(idx)+B(:)

3 years ago | 0

Load more