Answered
How to find minor and major axes of an elliptical fit?
ellipseAxes = B.'*efit.R

4 years ago | 0

| accepted

Answered
plotting vectors with differnt length
Below is one possibility, but you've left us much room for speculation on how the plot should look. t = [1 2 3 4 ]; x = [1 2 3...

4 years ago | 0

| accepted

Answered
Asterisk appearing during row operation
Presumably, it's just a display choice to keep things readable. The number there does exist, but they don't want to give you the...

4 years ago | 0

| accepted

Answered
Which one is the right answer, sum(w(:)) or sum(sum(w))?
sum(sum(w)) will generally be slower, because it requires 2 function calls. Also, it only works for 2D arrays whereas sum(w(:)) ...

4 years ago | 0

Answered
I need to draw arc through three points in three-dimensional space. Can you please help me out?
I would suggest this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for-fitting...

4 years ago | 0

| accepted

Answered
I need to draw arc through three points in three-dimensional space. Can you please help me out?
x_i = [0,5,20]; y_i = [0,0,0]; z_i = [20,5,0]; line(x_i, y_i,z_i); view(3); grid on

4 years ago | 0

Answered
Question about FMINCON in optimization
You shouldn't be using syms, or at least you need to at some point convert your sym expressions as actual numbers. Anything gene...

4 years ago | 0

| accepted

Answered
Normalization of zero padded signals
So why do I always read the FFT should be scaled by the number of samples before zero padding (in this case 4) if I am interes...

4 years ago | 0

Answered
how to find a line perpendicular to another line?
The equation is, dot(X-Y,Z-Z0)=0 where Z0 is a known point on the desired line. X = [126.3798 126.3818]; Y = [37.5517 37.549...

4 years ago | 0

Answered
Is there a function that does the same thing as the numel function?
Assuming X is one of the built-in Matlab variable types, prod(size(X)) or length(X(:))

4 years ago | 0

| accepted

Answered
Create vector with variable spacing
PRI = [0.0624 0.054 0.0636]; n=ceil(360/sum(PRI)); Bearings = [0, cumsum(repmat(PRI,1,n))]; Bearings(Bearings>360)=[]

4 years ago | 1

| accepted

Answered
Different results using curve fitting app
The performance of a custom fit generally does depend on the StartPoint that you've selected. You should probably use the non-c...

4 years ago | 0

| accepted

Answered
Indexing of an array
Simplified example: array=randi(10,5) test=array(:,5)>4; subset=array(test,:) %rows where 5th column is greater than 4

4 years ago | 0

| accepted

Answered
Calculate area of inside polygon using inpolygon
The polyarea command is for calculating polygon areas. You can also use polyshape.area.

4 years ago | 1

Answered
I am writing an optimization problem on MATLAB, but I am obtaining the following error: "Illegal assignment into an OptimizationVariable".
These need to be constraints: Cons(1) = SOC(1)== 30; for k=2:24 Cons(k) = SOC(1,k)== 0.2*SOC(k-1) + Ec(1,k)*lambdac - Ed(...

4 years ago | 0

Answered
Transfer learning using UNet
If you already have a pretrained U-Net, I imagine you could modify the output layers manually, as described in, https://www.mat...

4 years ago | 0

| accepted

Answered
trouble with finding sum in a for loop
You should of course never do it this way. an2 = findSum([5 5 5 0 0]) function result = findSum(vector result=0; ...

4 years ago | 0

| accepted

Answered
How to plot data in vertical lines
However this is not pratical Why not? It can certainly be shortened from what you have, though: x=[1 2 3 4]; y1=[3 2 3 1]; y...

4 years ago | 1

| accepted

Answered
Accumarray for two functions?
Since accumarray is faster than for-loop, but calling it twice will be slow. I would argue that 3 calls to accumarray would be...

4 years ago | 1

| accepted

Answered
Splitting Matrix based on another matrix
popx=[52.647 10.912 2.389 52.564 10.911 2.389 52.569 10.912 2.389 52.569 10.912 2.389 52.569 10.913 2.389 ...

4 years ago | 0

Answered
Splitting Matrix based on another matrix
This might be what you want. popx=[52.647 10.912 2.389 52.564 10.911 2.389 52.569 10.912 2.389 52.569 10.912 2.3...

4 years ago | 0

Answered
how to resize image 3D
Use imresize3.

4 years ago | 0

| accepted

Answered
Simultaneous lsqcurvefit for data set with shared parameters
I don't know if this was the solution you were expecting. The residuals don't look too bad, especially for such a small amount o...

4 years ago | 0

| accepted

Answered
Is there a way to pass a function handle as an argument for fsolve command?
F is already a function handle, so the call should be something like, F = @(y) [y(2); (R*omega^2/l)*cos(y(1) - omega*t) - (g/l...

4 years ago | 0

Answered
Convex set: Finding the A and b matrices from Ax=b when the points of the convex set is known.
Make a change of variables in the problem by rewriting x in terms of an unknown vector of coefficients where ...

4 years ago | 0

Answered
How does MATLAB allocate memory while solving large (10m-ish) linear systems?
With 5m variables and a density of 0.01%, your matrix is going to consume about 56GB even before mldivide starts to do any work...

4 years ago | 0

| accepted

Answered
Calculating exponentials using only addition?
Hint: first build a function that implements multiplication. Then use recursion, noting that a.^n is the same as a*a^(n-1).

4 years ago | 0

Answered
Cumulative sum between two trues in array according to positions stored in logical array
v=[0;1;2;0;2;4;5;6;2;3;4]; pos=[true;false;true;false;false;true;false;true;false;false;true]; cv=cumsum(v); I=find(pos); ...

4 years ago | 0

| accepted

Answered
how to solve polygon subtract problem?
Express the 2 regions as a polyshape vector: p1=nsidedpoly(1000); p2=nsidedpoly(1000,'Center',[1,0]); p3=subtract(p1,p2); p4...

4 years ago | 0

Load more