Question


Is there a way to interactively move a plot legend in a Live Editor figure?
In a normal figure window, I can reposition a plot legend by clicking and dragging. Is it possible to do something similar in a ...

6 years ago | 1 answer | 1

1

answer

Answered
Best way to move multiple objects with a preallocated matrix of coordinates?
I see movement when I do this, xl=xlim; for b=1:1:nStarts*nCarsPerStart for h=nStarts+1:nStarts:nStarts*(t+1) ...

6 years ago | 0

| accepted

Answered
averaging images and subtracting one image from the other
For example, setA=rand(256,256,10); setB=rand(256,256,10); imageA=mean(setA,3); imageB=mean(setB,3); result = imageB-im...

6 years ago | 0

| accepted

Answered
Trying to do a curve fitting but having trouble getting it to work.
Do you happen to know why I keep getting the "local minimum possible" Because lsqcurvefit thinks it succeeded in finding a sol...

6 years ago | 0

Answered
Need help creating a variable with different names or a method for saving a variable to different names.
for k=1:K S(k).A(i,j) = readline(s); S(k).B(i,j) = readline(s); S(k).C(i,j) = readline(s); S(k).D(i,j) = readline(s); e...

6 years ago | 0

| accepted

Answered
Index in position 1 exceeds array bounds.
Notice! x=rand(5,500); x=x(1:256,1:256);

6 years ago | 0

Answered
How to find number of elements using a for loop
for i=1:numel(A), A(i)>2, end

6 years ago | 0

Answered
extracting two specific columns from matrix (Indexing)
x=xxx(:,[1,3])

6 years ago | 0

| accepted

Question


Inheriting help documentation from an Abstract base class method
Suppose I have a base class with many subclasses, each of which will override an abstract method in the base class, classdef Ba...

6 years ago | 1 answer | 3

1

answer

Answered
Nonlinear fit instead of setting up a non linear equation?
Your problem appears to be a linear fit. I see no non-linear dependence on x or y. You should therefore use lsqlin, if you also ...

6 years ago | 1

| accepted

Answered
Would you let me know one of the fastest (or the most efficient) ways to merge data?
final_data = cell2mat(data(:))

6 years ago | 0

| accepted

Answered
Inf computed by model function, fitting cannot continue. Try using or tightening upper and lower bounds on coefficients.
the fit created by the function y(x) is very, very poor. Basically, it is straight line The fit looks very good considering you...

6 years ago | 1

| accepted

Answered
Calling superclass method outside of redefined method
It should be enough just to provide an overriding analyze() method in the subclass, classdef DataApproximator < DataAnalyzer ...

6 years ago | 0

Answered
Calling superclass method outside of redefined method
Why do you have to do it through inheritance? Couldn't you pass a function handle to the analyze() method that you want as a con...

6 years ago | 0

Answered
How to evaluate functions for every possible input parameter combination?
You can use ndgrid, [X,Y,Z]=ndgrid( 0:5:1000); F = X.^2 + Y; G = Y.^2 + Z; H = X + Y + Z.^3; idx=(F<=5); locations =...

6 years ago | 1

| accepted

Answered
Using optimization Toolbox without Objective functions, only set of points
in total I have 10 of these set of points You are minimizing over a small, finite set of things. Just use min().

6 years ago | 0

Answered
adjmat unrecognized function in Matlab
Is adjmat supposed to be computing the adjugate of the matrix t5. If so, you might be able to use this instead, https://www.mat...

6 years ago | 0

Answered
Calculating a matrix from other matrices
Q=eye(n); Mcell=cell(n,1); for i=1:N Mcell{i}=C*Q*B; Q=A*Q+Q; end M=cell2mat(Mcell);

6 years ago | 0

Answered
tangent plan at fixed point
You can use gradient() to calculate the normal to the plane.

6 years ago | 0

Answered
Problem concerning the fitness function of the genetic algorithm on MATLAB.
Make y1 and y2 the same size and shape (i.e., make sure both are row vectors or both column vectors).

6 years ago | 1

| accepted

Answered
decrease the vertical space between the subplots
Instead of subplot(), use subaxis() from the File Exchange.

6 years ago | 0

Answered
Implicit surface plot of a finite cylinder
The solution, as it turns out, was fairly simple: args={'EdgeColor','none','FaceColor','c','FaceAlpha',0.3}; fimplicit3(@fun...

6 years ago | 0

| accepted

Question


Implicit surface plot of a finite cylinder
Using fimplicit3, I can plot an infinite cylinder, like so: args={'EdgeColor','none','FaceColor','c','FaceAlpha',0.3}; fimpl...

6 years ago | 1 answer | 0

1

answer

Answered
Matrix Optimization using optimization toolbox - "Objective must be a scalar OptimizationExpression or a struct containing a scalar OptimizationExpression."
You do not have a minimization problem. You just have a system of equations that you are trying to solve. For that, you would us...

6 years ago | 1

| accepted

Answered
How to obtain the standard error for each of the fitted parameters
If you're prepared to assume the parameter estimates have Gaussian errors, perhaps you can find the 95% confidence interval widt...

6 years ago | 0

Answered
How to substract every two adjacent column from a matrix
Perhaps this is what you were looking for, y = conv2(x,[1,0,-1],'same')./x;

6 years ago | 0

Answered
loop doesn't work
Note that you can use sepblockfun https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-operations t...

6 years ago | 0

| accepted

Answered
Matrix subtraction every two adjacent column
y=diff(x,1,2);

6 years ago | 0

Answered
pattern division multiple access
There seem to be a number of possibly relevant File Exchange offerings: https://www.mathworks.com/matlabcentral/fileexchange?q=...

6 years ago | 0

Load more