Answered
how to generate multiple curves with the same track length
Using interparc from the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/34874-interparc?s_tid=srchtitle f...

4 years ago | 1

Answered
Vertically-stacked subplots cannot be made the same width and to be vertically aligned
Something to do with daspect(). Omitting it gives the intended edge alignment. Units='normalized'; h1 = subplot(2, 1, 1); %...

4 years ago | 0

| accepted

Answered
How to Search a struct array?
Perhaps this is what you meant? somedata = alldata([alldata.ID]=="864475047572713")

4 years ago | 0

| accepted

Answered
How do I return the index of a vector I am defining?
In normal Matlab practice, you would vectorize withinBounds so that the operation could be done like this: e1_v1_parameters = [...

4 years ago | 0

Answered
How do I extract the first non-zero value from array after specified number of zeros?
Using this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetition...

4 years ago | 0

Answered
Tiledlayout with separate tile spacing in rows and columns?
It's not possible with tiledlayout, but this FEX download offers that kind of control: https://www.mathworks.com/matlabcentral/...

4 years ago | 1

| accepted

Answered
rotate points on a line
You can imitate the following example. h=plot(1:5,'--x'); center=[2,2,0]; for i=1:10:360 rotate(copyobj(h,h.Parent),...

4 years ago | 1

| accepted

Answered
How to generate surface from scatter3 with xyz coordinates and specified color
Perhaps as follows, [x,y,z]=deal(tbl.pred1,tbl.pred2,tbl.pred3); T = delaunay(x,y); trisurf(T,x,y,z)

4 years ago | 0

Answered
Interpolation between two 2D projective geometric transformations
You could trysomething like this, c=0.5; t3=projective2d(c*t1.T+(1-c)*t2.T) though I don't have a mathematical proof, off the...

4 years ago | 0

| accepted

Answered
Finding equation of a plane using three points as well as using noisy data
You can use planarFit() in this FEX download https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-f...

4 years ago | 0

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

Load more