Community Profile

# Matt J

Last seen: Today Active since 2009

Professional Interests: medical image processing, optimization algorithms

All

#### Content Feed

View by

Use of fminsearch in logscale
Well, that could make sense. On a log scale, much of your data could be either very far away from the central portion of the 3 G...

circa 13 ore ago | 0

Surface plot error for Z must be a matrix, not a scalar or vector
Just don't know how to make z a matrix after sph2cart z will be a matrix if at least one of the inputs f, theta and phi are mat...

circa 22 ore ago | 0

Why is my plot linear when the anonymous function z is clearly nonlinear?
It simply looks linear because you are plotting it over too narrow a range. Req = 0:120000; plot(Req,z(Req));

circa 23 ore ago | 2

| accepted

Transpose for double integral
To perform the double integral, f(x,y) needs to be calculated at all combinations of x(i) and y(j). The transpose makes x a colu...

1 giorno ago | 1

| accepted

How to load variables from Excel into Matlab workspace?
if you have many columns of data to load, you would not put them in separate workspace variables. You would just read them into ...

1 giorno ago | 1

Compute Volume of Cubic element from coordinate
One way: [~,volume(i)]=convhull( Coordinate(Element(i,:),:));

2 giorni ago | 0

Solve taking too long, how to optimize code?
Well, one solution is clearly, T1=T2=T3=T4=T5=(Tsurr-273) as you can verify by direct subsitution.

2 giorni ago | 0

How to plot the value of a matrix?
plot(yourMatrix)

2 giorni ago | 0

what changes should i make in final optimised value with opt time vector
Use prob2struct s=prob2struct(prob); s.f0 The value of s.f0 will be the discrepancy between a problem-based linear optimizati...

2 giorni ago | 0

fminunc giving correct optimized values for anonymously defined function, BUT wrong value for .m function
At same initial values in two cases (anonymous function and .m function) the objective function gives same values which means th...

2 giorni ago | 0

How do I create a matrix that has as values ​​the averages of variables found in loops?
If that's all you want to do, you shouldn't be saving the coordinates of the ROIs. You should just create a binary mask BW of ea...

3 giorni ago | 1

| accepted

How to assign a specific values to the nearest X,Y point

4 giorni ago | 0

I am trying to compute the zero of a function using fzero, but the system always says my function must be finite and real. How can I solve that? Thank you!
Clearly, your function is non-finite at x=0. There is a factor of x^2 in its denominator. Regardless, fzero() is the wrong too...

5 giorni ago | 0

| accepted

Loop in a cell array that consist of matrices in each cell
Easier: results=cat(3,results{:}); max_column = squeeze( max(results(2:end,12,:)) )

5 giorni ago | 0

Loop in a cell array that consist of matrices in each cell
You have a variable called "max" previously defined in your workspace.

5 giorni ago | 0

I would like a function to remove the duplicate values, but one that removes the duplicate value as well.
USing the functions in https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-...

5 giorni ago | 0

| accepted

fminunc crashes matlab if large number of input variables used
Well, the practice you have of cumulatively nesting anonymous functions inside one another is asking for trouble. You should at ...

5 giorni ago | 1

| accepted

How to apply logical matrix to the matrix with array operation?
Matrix = [ 3 4; 5 6]; Logical= [ 1 1 ; 0 0]; R=Logical.*Matrix

6 giorni ago | 0

| accepted

How to substitute one value in vector by vector?
x=[-1 1 -1 1]; X=kron(-x,[1,2,3]); X=X+4*(X<0)

6 giorni ago | 0

How to substitute one value in vector by vector?
x=[-1 1 -1 1]; x=strrep(10*x,10,[3,2,1]); x=strrep(x,-10,[1,2,3])

6 giorni ago | 0

why the caculation results is different for parfor-loop and for-loop?
Probably because, with a parpool active, the matrix multiplication code cannot multithread the operation in precisely the same w...

6 giorni ago | 1

Is there any exmaple on how to apply fmincon function to a state space optimisation problem?
These should be applicable, https://www.mathworks.com/help/optim/ug/fit-ode-problem-based-least-squares.html https://www.mathw...

6 giorni ago | 0

How to substitute one value in vector by vector?
x=[-1 1 -1 1]; i=(x+3)/2; V=[1 2 3;3 2 1].'; X=reshape( V(:,i) ,1,[])

6 giorni ago | 0

How to substitute one value in vector by vector?
x=[-1 1 -1 1]; idx=(x==1); X=nan(3,numel(x)); X(1,idx)=3; X(2,idx)=2; X(3,idx)=1; X(:,~idx)=4-X(:,idx); X=X(:)....

6 giorni ago | 0

Calculation of Hessian matrix in gamultiobj hybrid function
If you mean that you can't compute the Hessian yourself and wish to do so using finite difference approximations then https://w...

6 giorni ago | 0

Finding the average of the neighbors of each pixel in an image
mean4=conv2(image,[0 1 0; 1 1 1; 0 1 0]/5,'same'); mean8=conv2(image,ones(3)/9,'same');

6 giorni ago | 1

Issue while fitting semi-circle on a set of points
See incircle() in https://www.mathworks.com/matlabcentral/fileexchange/34767-a-suite-of-minimal-bounding-objects?s_tid=srchtitl...

6 giorni ago | 0

Issue while fitting semi-circle on a set of points
I recommend circularFit from https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for-fitting-conic...

6 giorni ago | 0

| accepted