Answered
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side
parfor i=1:16000 tmp=double(solve(f==A(i),x)); if isempty(tmp), warning 'No sol...

5 years ago | 1

| accepted

Answered
Newton's method
Tab=[]; for x = -1:0.05:5 Tab = [Tab , newton(@f1,@df1,x,10^(-8)) ] end

5 years ago | 0

| accepted

Answered
add a row to a matrix each loop
Just concatenate: A=eye(5) newrow=rand(1,5); A=[A;newrow]

5 years ago | 0

Answered
Registering two images where the camera has translated
The default multi-modal options seem to work pretty well. imreader=@(z,s) imresize(rgb2gray(imread(z)),s); %Register at ...

5 years ago | 0

| accepted

Answered
How to draw 9 cones using kronecker product?
If you have the matrix of surface values of a single cone, you could simply do, surf(kron(ones(3), singleCone))

5 years ago | 0

| accepted

Answered
Why does my matrix give me a syntax error
(It follows the END that terminates the definition of the function "Fnorm".) That is not allowed. All local functions must be p...

5 years ago | 0

Answered
How can I make MATLAB shade the area of the virtual intersection between two lines?
You can use fill() or patch().

5 years ago | 1

Answered
How to select rectangle ROI in the image and adjust the position of ROI manually. Then it can return the adjusted ROI position
h=drawrectangle(); wait(h); You must double-click on the rectangle to confirm its position and return control to Matlab.

5 years ago | 0

| accepted

Answered
Mirrored ifft and ifft2
If you do ifft(x,'symmetric'), the actual right hand side values will be ignored, or rather assumed to be a mirroring of the lef...

5 years ago | 0

Answered
How to change optimization variable
You cannot do that in a continuous optimization problem, although in sparse optimization, it is common to approximate the number...

5 years ago | 1

| accepted

Answered
Curve fitting with set area
The area constraint is non-linear. You would have to use fmincon instead.

5 years ago | 0

| accepted

Answered
fsolve doesn't find a solution when the value of the objective function is obtained through a Montecarlo simulation
Does your Monte Carlo simulation also compute an approximation to the Jacobian, or are you relying on fsolve's default finite di...

5 years ago | 0

Answered
Quadratic Constraints/Optimization error in Matlab 2020b but not Matlab 2020a
Was MATLAB running an old version of strjoin.m that was incompatible with the problem based optimization? Yes, it appears that ...

5 years ago | 0

Answered
why my matlab didn't plot anything?
m = 85; g = 9.81; ti = 0; tf1 = 9 ; v(1)= -20; h = 1; c1 = 11; dv1 = @(g,c1,v,m) g-c1*v/m; k=1; while(ti<tf1) ...

5 years ago | 1

| accepted

Answered
Remove steps of adjacent points
Perhaps as follows: threshold=0.5; t=0:0.01:3; signal=log(mod(t,1)+1); D=diff(signal(:).'); D(abs(D)>threshold)=0; ...

5 years ago | 1

| accepted

Answered
simple fmincon problem, optimization toolbox
The point X=[0,0,0] is a first order local minimum. It is a point of zero-gradient, and it satisfies the constraints. You made a...

5 years ago | 0

Answered
How to get matrix indices from roipoly
You must interchange the coordinates (i,j)=(yi2,xi2)

5 years ago | 0

| accepted

Answered
Is it possible to set an upper limit on the step size used by fsolve?
I've tried using fmincon with the same initial guesses as fsolve without success: A simpler option than fmincon would be to us...

5 years ago | 0

| accepted

Answered
Problem in calculating median and average values at specific intervals.
valid=(Phase~=0); G=findgroups(round(Temp(valid),0)); Radius=Radius(valid); Phase=Phase(valid); medianRadius=splitapply(...

5 years ago | 0

| accepted

Answered
How to use unique in an mxn matrix without sorting the columns?
A = [7, 2, 1, 1; 3, 2, 9, 9] a_no_duplicate = unique(A.', 'rows').' a_no_duplicate_no_sort = unique(A.', 'rows','stable').'

5 years ago | 1

| accepted

Answered
help with Integral function
I don't think you've posted the version of the code that you are running. As you can see above (I have edited and run your code ...

5 years ago | 0

Answered
Lsqcurvefit parameter problem for high degree polynomials
A degree 10 polynomial has 11 degrees of freedom if the leading coefficient (in this case "a") is treated as unknown. So over-pa...

5 years ago | 0

| accepted

Answered
Z-angle of a fit-plane having 4 points
You can fit a plane to the points using planarFit() in this downloadable package: https://www.mathworks.com/matlabcentral/filee...

5 years ago | 0

Answered
How to rotate ylabel but still auto-resize plot axes?
ylabel('TEST [-]','FontSize',fo_axis,'rotation',0,'HorizontalAlignment','right')

5 years ago | 0

| accepted

Answered
How to split an image into two and save it to a file
left=Image(:,1:round(end/2)); right=Image(:,round(end/2)+1:end ); save File.mat left right

5 years ago | 0

Answered
Using find for a 3D matrix and then returning a matri
[~,locations]=max(rho1<0,[],3);

5 years ago | 1

| accepted

Answered
Is there a way I can assign values to a vector of names?
Yes, if you make the names the fields of a struct, for i = 1:length(bcvalues) S.(bcvalues{i}) = NaN(1,30); end

5 years ago | 2

| accepted

Answered
How to regrid into different resolution without interpolation?
Using, https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-operations sepblockfun(data,[2,2],'mean...

5 years ago | 0

Answered
How to use ~= operator as constraint function?
Here: but how do I extract the X for which X~=F. Is there a function for this? Yes, but clearly you are not doing continuous op...

5 years ago | 1

| accepted

Answered
Combining many matrices into one using loop.
Store them in a cell and then concatenate, e.g., for i=1:4 C{1,i}=rand(10,randi(5)); end C, A=[C{:}]

5 years ago | 0

| accepted

Load more