Answered
Suggestions to speed up FFT of convolution
If you have R2022a, Mhelp=repmat(M,[rep(1),rep(2),rep(3),1]); %Fourier transform ftM=fftn(-Mhelp,[nxP nyP n...

4 years ago | 1

Answered
Suggestions to speed up FFT of convolution
I see a doubling of the speed if you re-organize your4D and 5D arrays as cell arrays: Mhelp=num2cell(Mhelp,[1,2,3]); ftN=squee...

4 years ago | 1

Answered
How to remove a range of rows from all nested structures of a parent structure?
s.a.f=[1,2,3]; s.b.f=[4,5,6]; s.a,s.b for F=string(fieldnames(s)') s.(F)=structfun(@(f)f(1), s.(F),'uni',0); ...

4 years ago | 0

Answered
Summation of column elements of matrix A from index values of matrix B
A=randi(10,3) , B=randi(10,3); [m,n]=size(B); [~,I]=sort(B), J=repmat((1:n)',1,m); D=sum( A( sub2ind(size(A),...

4 years ago | 0

| accepted

Answered
MATLAB lsqcurvefitting using real data
This example shows how to read data from a specified sheet, https://www.mathworks.com/help/matlab/ref/readmatrix.html#mw_8ad99a...

4 years ago | 0

Answered
Overloading math operations on cell arrays
I don't want to define a class, but just add cell arrays without fuss. What's the big deal with defining a class? See attached...

4 years ago | 0

Answered
Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to reduce operands to logical scalar values.
As you can see from the debugger screenshot your t does not remain a scalar as your code loops. Is that supposed to happen, and ...

4 years ago | 0

Answered
What is the difference between valuechangedfcn and valuechangingfcn?
Is that for doing something when a user clicks within the field and has not yet finished entering the new value, and the GUI wou...

4 years ago | 2

Answered
valid indices in a parfor loop
You are trying to use the parfor loop to fill a pre-existing matrix mat. The only type of parfor variable for which this is allo...

4 years ago | 0

| accepted

Answered
Solving the linear equation
Because you have 72 equations and only 9 unknowns. The system is over-determined.

4 years ago | 1

| accepted

Answered
How do I detect, count and measure the average diameter of the bubbles from matrices of temperatures.
If you have a binary map BW of the bubbles, then you can use regionprops to compute the diameters. T=regionprops('table',BW,'Eq...

4 years ago | 0

Answered
Double and character format in one cell, how to remove the double format?
load multiday for i=1:60 multiday{i}(end+1:264)={''}; end multiday1=[multiday{:}]

4 years ago | 0

Answered
How to crop image from two added image
im1=Image(:,1:N,:); im2=Image(:,N+1:end,:);

4 years ago | 0

Answered
difference between alternate rows in matrix, storing and agin finding difference between alternate rows
drw=diff( rw(1:2:end,:),1,1 ); ddrw=diff( rw(1:2:end,:),2,1 );

4 years ago | 0

Answered
need for the Optimisation toolbox
Yes.

4 years ago | 0

Answered
Length of a plotted line
h=plot(2:6); xlength = h.XData(end)-h.XData(1)

4 years ago | 0

| accepted

Answered
Merging the Cell Array Elements
C=string(reshape(yourCell,2,[])'); out=cellstr( C(:,1)+C(:,2) );

4 years ago | 0

| accepted

Answered
Convert 2d image to 3d
You cannot recover a 3D point from only a single 2D projection of that point. This is because every point [X,Y,Z] along the line...

4 years ago | 0

| accepted

Answered
Problem with optimization using fmincon
It looks like there are supposed to be some additional, more interesting constraints. Otherwise, if you have only bounds, the mi...

4 years ago | 1

| accepted

Answered
nonlinear problem with 300 varibales
Although increase iteration number and MaxFunctionEvaluations but it shows same message as follows My guess would be that you ...

4 years ago | 2

| accepted

Answered
Remove array elements if a certain condition is met with a for loop
Value( all(abs(JDF)<=2.5,2) )=[];

4 years ago | 0

Answered
How to perform image registration on non-rectangular image
If you have the Optimization Toolbox, you could use lsqcurvefit (don't be misled by the name) to minimize your own reigstration...

4 years ago | 0

Answered
How to do "not equal to" constraints in fmincon/Global search?
I need to test somehow if the solution i get from Global Search is unique. The run() command, with 5 output arguments, can ret...

4 years ago | 0

| accepted

Answered
Should we always search for the global minima in our optimization problem?
I am wondering should we always search for the global minima in our fitting (optimization) problem by using e.g. multistart or g...

4 years ago | 1

Answered
How to do "not equal to" constraints in fmincon/Global search?
You could impose a constraint like as a smooth approximation to . function [c,ceq,gradc,gradceq]=nonlcon(x,r) ceq=[]; g...

4 years ago | 0

Answered
Center to center distances between lines: Error in vertical distances
See here, https://www.mathworks.com/matlabcentral/answers/1718920-how-to-measure-and-show-the-center-to-center-distance-between...

4 years ago | 0

Answered
How to plot a function continuously by dragging a slider in AppDesigner
Use the ValueChangingFcn callback instead of the ValueChangedFcn callback. See also this example, https://www.mathworks.com/hel...

4 years ago | 1

| accepted

Answered
How to define double slits on x-axis
u=@(x) abs(x-0.05)<=0.05 | abs(x-10.15)<=0.05; tiledlayout(1,2); nexttile; fplot(u,[-0.1,0.2]); axis padded nexttile; fplot...

4 years ago | 1

| accepted

Answered
Randomly select a column
x=n(:,randperm(100,20))

4 years ago | 0

| accepted

Answered
Is there a built-in function to validate a class property that should be a cell array?
There is always iscell(): classdef ... methods function obj=set.A(obj,A) assert(iscell(A),'Value assigned to A ...

4 years ago | 0

Load more