Answered
select rows based on the value of the last column of the matrix
This solution requires only 1 sorting operation. A = [334 1358 175 3 335 1359 176 3 335 1359 175 1 336 1360 176 2 337 1361 ...

2 years ago | 1

| accepted

Answered
save each struct to vector-like format
I think you have a misunderstanding about what a struct is. None of the variables in your code are structs. However, the followi...

2 years ago | 0

| accepted

Answered
keep a firm column in scrolling
Perhaps put the still-column in its own separate table, but position them side-by-side so that they look like just one table.

2 years ago | 0

| accepted

Answered
How to append text and numbers into a title
start_month=12; start_day=1; mth = month(datetime(1, start_month, 1), 'Name'); % To get the name of the month title({'C. Beau...

2 years ago | 1

Answered
common legend and common for multiple plots
% Make up data: xivals = 1:10; intul = rand(1,10); intabsul = rand(1,10); intur = rand(1,10); intabsur = rand(1,10); %...

2 years ago | 0

| accepted

Answered
How can the plot be divided into 2 using the graph line?
Perhaps something like the following: load roadPoints [X,Y]=ndgrid(0:2.5:100); p1=polyshape([roadPoints;min(roadPoints(:,...

2 years ago | 1

| accepted

Answered
adding all fields of a structures
Tables=arrayfun(@(f)mystruct.(f) ,"bin_"+(1:10) ,'uni',0); my_new_struct.Bin=vertcat(Tables{:});

2 years ago | 1

Answered
Remove non-finite values while decimating
Likely, there are NaNs in your data that you have to remove. find(~isfinite(data{:,4}))

2 years ago | 0

Answered
Curve fitting a function that is dependent on a difference of 2d functions
The Curve Fitting Toolbox is meant for fitting a small number of parameters. Here, you have 15 parameters, so you should use ls...

2 years ago | 0

Answered
Display 4D double size with Editor datatips
If you mean you want the dimensions displayed in the form AxBxCxD, I don't think there is any way to have the Editor datatip do ...

2 years ago | 1

Answered
Padding flag of the formatting operator in compose()
Because then the length of the string would be 8 instead of 5. compose("%08.2f",45.23)

2 years ago | 1

| accepted

Answered
Array Problem How can I unpack an array? why the firt element pf my array is always 0?
To unpack, you can do [I1,I2,I3]=deal( I(1), I(2), I(3) ) or, Icell=num2cell(I); [I1,I2,I3]=Icell{:}

2 years ago | 0

Answered
Can I apply branch and bound and use linprog function to minimize a function? if there is an example please share it
Add additional binary variables b1,b2 and equality constraints as below. Then it becomes a straightforward application of intlin...

2 years ago | 0

Answered
Saving resized figures in loop does all but last correctly
Maybe use export_fig or exportgraphics, instead of saveas.

2 years ago | 0

| accepted

Answered
Saving resized figures in loop does all but last correctly
Maybe issue a call to drawnow? h = findall(groot, 'Type', 'figure'); for numFig = 1:length(h) figure(numFig) s...

2 years ago | 0

Answered
How to remove thin lines in binary image
Image=imopen(Image,ones(3));

2 years ago | 1

Answered
Plot a Cuboid with a cylindrical shaped hole in 3D
[X,Y,Z]=meshgrid(-150:150); V=(X.^2+Y.^2>=80^2 & max(abs(X),abs(Y))<=120); V(:,:,[1,end])=0; V=V+0.5*imerode(V,ones(3,3,3...

2 years ago | 1

Answered
How can the plot be divided into 2 using the graph line?
Perhaps you can find the nearest point on the boundary line with pdist2, then make a decision based on whether the nearest point...

2 years ago | 0

Answered
How to deal with the Hermitian matrix that is meant to be positive semidefinite but turned out to have negative eigenvalue due to numerical issues?
You can add a small multiple of eye(N) to raise the eigenvalues above zero F=F+small_number*eye(size(F))

2 years ago | 0

Answered
How can I solve a nonlinear matrix equation, and get the possible _matrices_ as my output, instead of a struct of 1-dimensional solutions?
I would like to solve for the matrix P directly instead ... Is this possible to do? No, but the manual work of assembling P at ...

2 years ago | 0

| accepted

Answered
How to use a sliced cell array as a reduction variable in parfor?
The update terms like logErrOuter_1(logErrOuter_1(:,2) == j,3) need to be the same size in every iteration i in order to be comp...

2 years ago | 0

| accepted

Answered
Repeat coordinates (arranged on the same y and different x) over different values of y
load row_c ; load val x=row_c(:,1); y0=row_c(1,2); %%% Engine [X,Y]=ndgrid(x, flip(y0-cumsum(val))); scatter(X(:),Y(:)...

2 years ago | 0

Answered
Evaulating a multiple valued function at multiple points
Another way is to make it so that the time variable t is vector-valued as well: syms t [1,4] f(t)= t.^(1:4) Times=3:6; %e...

2 years ago | 0

Answered
Evaulating a multiple valued function at multiple points
Is there some way to call my acceleration function with the (vector valued) min accel time in a single line or command? Yes, On...

2 years ago | 0

Answered
Multiply matrices in cell array by another matrix
If instead of creating A{i}, you can instead create a cell array B such that B{i}=A{i}.' , then it would be much more efficient,...

2 years ago | 0

Answered
Multiply matrices in cell array by another matrix
Using this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/115340-block-transposition-permutation-and-reshap...

2 years ago | 0

Answered
Calling functions that have a variable name
Just generate handles to all the functions. Then they can be used freely to make function calls, e.g., F=cellfun(@str2func, co...

2 years ago | 1

| accepted

Answered
How to represent gray scale images as affine subspaces?
Well, in general, we can write the estimation of A,b as the norm minimization problem, If X can be fit in RAM, you could just...

2 years ago | 0

Answered
Fit ellipsoid to (x,y,z) data
I'm finding that a decent fitting strategy is to first fit with a Gaussian, but then use the parameters of the Gaussian to const...

2 years ago | 1

| accepted

Load more