Answered
Genetic Algorithm + Parallel Computing + Global variables
If you're using UseVectorized, it should be relatively easy. Within your parfor loop, store the results of processing each popul...

4 years ago | 1

Answered
Why won't my superclass method change my subclass object?
You need, obj=obj.addSdata; obj=obj.addRdata; Or, read about handle classes.

4 years ago | 0

| accepted

Answered
How do I add anonymous functions together?
Is this possible without converting the anonymous function to a string? I was hoping for something along these lines: for n = ...

4 years ago | 0

| accepted

Answered
How do I add anonymous functions together?
Trying to sum/concatenate anonymous functions is a bad thing to do, in general. Here is one way to accomplish it, however, fstr...

4 years ago | 1

Answered
Smart Indenting now Removes Whitespace
This is just my suspicion but, in the Matlab editor, the tab key doesn't really seem to insert tab characters. It appears just t...

4 years ago | 0

Answered
2d extrapolation to replace NaN in corners
One option is fillmissing. There are also offerings on the File Exchange, e.g., https://www.mathworks.com/matlabcentral/fileex...

4 years ago | 1

| accepted

Answered
Why does a for loop iterate over an empty column vector?
Yes, I'm sure it's expected. There will be as many iterations as there are columns of "bob". k=0; for bob=zeros(0,5) ...

4 years ago | 1

| accepted

Answered
how to multiply each elements of the cell with a scalar quantity?
OptP{i} =@(sigma) scalar * vpa(solve(rate_k(pt,sigma)==rate_th,pt));

4 years ago | 0

| accepted

Answered
fitting a customised guassian equation to the curve
Apply whatever Gaussian fitting routine you usually use to the scaled data (X/sqrt(2*log(2)), Y).

4 years ago | 0

| accepted

Answered
How to replace values in one matrix across a range of indices?
event=rand(15,1); index_mat = [4 8 10 12]; L=steps(index_mat(:,1),numel(event)); U=steps(index_mat(:,2),num...

4 years ago | 0

Answered
Interpolation of 3D arrays against a 1D vector
[Nx,Ny,~]=size(Data); F=griddedInterpolant({1:Nx,1:Ny,t},Data); Data_new=F({1:Nx,1:Ny,t_new});

4 years ago | 0

| accepted

Answered
How to remove elements of a positive array in a one-on-one-off manner?
Y = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

4 years ago | 0

| accepted

Answered
Circle projection to be ellipse on the ground
The final position of the projected ellipse will depend on the z-coordinates that you have before the rotation. z = 10*ones(1,l...

4 years ago | 0

Answered
Extract specific X & Y data from Contour curve
This has worked pretty well for me, https://www.mathworks.com/matlabcentral/fileexchange/74010-getcontourlinecoordinates?s_tid=...

4 years ago | 1

Answered
How to develop a ramp up of values into a matrix
n=100; PnC=50; SL=repelem(210,1,n); SL(1:PnC(1))=linspace(200,210,PnC(1)); plot(SL); axis padded

4 years ago | 0

| accepted

Answered
How to "automatically" show an equation, written in the matlab editor, as a text on a plot
Does the text have to be situated inside the plot? ezplot() will automatically create a plot title displaying the mathematical f...

4 years ago | 0

Answered
How to limit fsolve to find solution in Real numbers domain
That will automatically be the case, as long as the equation functions you have provided are real-valued.

4 years ago | 0

| accepted

Answered
How to fill missing grid value in 3D matrix
There is a command for that: fillmissing.

4 years ago | 1

| accepted

Answered
pause a program while running and resume from the same spot
Yes, there is a command for it: pause.

4 years ago | 0

Answered
Optimizing a parametrized geometry with genetic algorithm
Whn generating y2, your current code attempt doesn't make it clear what values you intend for "A". Perhaps this is what you mean...

4 years ago | 0

Answered
Transform ellipse obtained from oblique slice of a cylinder to a circle
Use fitgeotrans with an 'affine' transformation type to determine the necessary transformation. The output wll then be in a form...

4 years ago | 0

Answered
How to transpose many matrices X_1 ... X_N at once?
The matrices must be put into some kind of container if you want to operate on them as a group. If you can't cat() them, then th...

4 years ago | 2

Answered
How to transpose many matrices X_1 ... X_N at once?
In R2020b or higher, you can use pagetranspose or pagectranspose X=randi(9,3,3,2) Y=pagetranspose(X)

4 years ago | 1

Answered
How can I create a vector
a=[2,4,3]; b=1./repelem(a,a)

4 years ago | 0

Answered
How can I find all possible solutions to a LP?
If the convex hull is a bounded polyhedron, you can use lcon2vert from, https://www.mathworks.com/matlabcentral/fileexchange/30...

4 years ago | 0

| accepted

Answered
How can I fix SOLVE ignores UseParallel when derivatives calculated automatic differentiation warning for parallel computing?
It's not something to fix. It's what you want. Analytical differentiation is the fastest option, when it is available.

4 years ago | 0

Answered
How to get the coordinates of the point where the derivative is zero in curve fitter?
Assuming you have the cfit object f generated by the fit, fzero(@(x)differentiate(f,x), [a,b]) %search interval [a,b]

4 years ago | 1

| accepted

Answered
Display optimization variable/solution
pages=any(sol.x==1,[1,2]); disp(sol.x(:,:,pages) )

4 years ago | 0

| accepted

Answered
save each 2 dimensions of 3 dimensions matrix
As Rik says, it's a terribly inadvisable thing to do, however, here is one way you could accomplish it: s=cell2struct( num2cell...

4 years ago | 0

Answered
How can i extract coordinates of point from matlab figure ?
You already have the point data from your code: Xu,Yu.

4 years ago | 0

Load more