Answered
changing variable names when saving variables
What I want is that, when I open the variables I want it to call them a different name for every subscript. Now the variable is ...

5 years ago | 0

Answered
Mean, Max and Min of Structured Cell array
You should first convert everything to table form. Column3={{'dog';'dog';'dog'},{'cat';'cat'}}; %Original data Column4={[1;2;...

5 years ago | 1

| accepted

Answered
Is it possible to write methods that iteratively process each element of an objectarray without writing for-loops each time?
It is not possible in a get.property() method, but it is possible in a normal method. function meanValues = mean(Objects) ...

5 years ago | 0

| accepted

Answered
Sum of a portion of 3D matrix elements
[I,J,K]=ndgrid(1:N); total = sum(A(I<=J & J<=K))

5 years ago | 0

| accepted

Answered
'drawcircle' and 'roi.cricle' do not respect preset Radius
I think you need to specify the center coordinate as well.

5 years ago | 0

Answered
How do I delete slices in 3D-Array?
Saravanan Sengottuvel's answer moved here: Generating an example 3D array that has 10 slices A = repmat([0 0 0 0; 1 0 0 0; 1 0...

5 years ago | 0

| accepted

Answered
Calculating a matrix with a specific form
Another solution, using func2mat (Download). N=size(x,2); C=func2mat( @(m)cross(repelem(m,1,N),x) , ones(3,1) , 'doSparse',0...

5 years ago | 0

Answered
Simultaneously interpolating over multiple rows of a matrix.
This might be better, e=1:K; F=griddedInterpolant(mat(ind1,:),{e,grid}); vals_temp = F(e,qvec);

5 years ago | 0

| accepted

Answered
Simultaneously interpolating over multiple rows of a matrix.
V=mat.'; vals_temp = interp1(grid,V(:,ind1),qvec);

5 years ago | 0

Answered
How to find the first number, ignore subsequent until a greater number repeats.
Is this what you want? A = [ 0 3 0 3 0 3 0 3 0 4 0 4 0 4 0 4 0 5 0 5 0 5 0 5 0 5 0 3 0 3 0 3]; cA=cummax(A); b1=find(A==3...

5 years ago | 1

Answered
Deleting rows with specific values within a matrix
Hint: do something with this line: ind = any( A==0 | abs(A)==10 ,2)

5 years ago | 1

Answered
Matlab clears persistent and global variables in fmincon when activating UseParallel
This happens because, in parallel computing, it isn't easily definable what it means for a variable to "persist". A peristent va...

5 years ago | 2

| accepted

Answered
How to add a legend to all open figures?
For example, %% Open several figures with subplots for i=1:2 figure(i) for j=1:2 subplot(2,1,j) ...

5 years ago | 0

| accepted

Answered
How can i plot multiple objects in same 3D space i.e. plot3 ?
Using hold on and hold off, you can add anything you want to a pre-existing 3D axis, even the results of a 2D plotting command. ...

5 years ago | 0

Answered
How to use fmincon with vectors? (error message: not enough input arguments)
fun = @(x) -100*(x(1,:)-x(2,:).^2).^2 + (test-x(1,:)).^2;

5 years ago | 0

| accepted

Answered
Hessian output using simulannealbnd and fmincon
I'm assuming you can't simply do an analytical Hessian computation at the solution you found... One alternative would be to run...

5 years ago | 0

| accepted

Answered
fsolve with multiple tolerance levels
You can use fmincon (instead of fsolve) to formulate the tolerances as nonlinear inequality constraints. Or you can use lsqnonli...

5 years ago | 0

Answered
Elliptical trajectory and plot waypoints for robotic arm simulation
Fairly easy to do with this FEX submission, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-fo...

5 years ago | 0

| accepted

Answered
Creating random non-discrete values and assigning weights
As an example, weightList=[0.4 , 0.1, 0.3, 0.2]; x=rand(1,6)*40, Weights = weightList(discretize(x,0:10:40))

5 years ago | 0

| accepted

Answered
String split from the line .
As an example, B=split( ',A,B,C,D' , ','); B=B(~cellfun('isempty',B))

5 years ago | 0

| accepted

Answered
Assigning Columns to Multiple Variables
for i=1:4, Q{i}=Table{:,i}; end [A,B,C,D]=deal(Q{:})

5 years ago | 1

| accepted

Answered
how to call function from one m file to another m file?
lmimeena must be told what to return in the declaration line, function L=lmimeena(A,C)

5 years ago | 1

| accepted

Answered
How to access parameter guesses made by MATLAB in lsqnonlin?
No, it is gradient-driven search, not a grid search. However, nearly all Optimization Toolbox solvers have an OutputFcn option,...

5 years ago | 0

| accepted

Answered
How to Connecting nearby pixels of binary image
imclose() is the traditional way to close small gaps between nearby pixels.

5 years ago | 0

Answered
create parallel lines in the same pic and find the average of all the ffts in it
The operation sounds the same, up to a scale factor, as doing fft(radon(yourImage,theta))

5 years ago | 1

Answered
create parallel lines in the same pic and find the average of all the ffts in it
Could you imrotate() the image so that it's rows are parallel to your line? Then, the operation would reduce to fft( mean( imr...

5 years ago | 1

| accepted

Answered
Minimise the sum of squared errors, with non linear constraints
The unnecessary use of nonlinear constraints can slow things down. Your constraints are in fact linear, and should be expressed ...

5 years ago | 0

Answered
Optimization problem, how to limit the individual values in the control vector to a certain range
Assuming the u(i) are non-negative, the condition can be written as a linear constraint. u=optimvar('u',[10,1], 'LowerBound',0)...

5 years ago | 0

Answered
Error using lsqcurvefit: Function value and YDATA sizes are not equal.
A = 0.3; omega = 1; phi = 0.1; c = 0.1; initialGuess = [A omega phi c]; fun = @(x,timearray) x(1) .* (sin((timearray .*...

5 years ago | 0

| accepted

Answered
Error in using nlinfit function
You are not using the taua coefficients passed as input to BinaryI2WL. You are overriding them for some reason with random value...

5 years ago | 0

Load more