Answered
Sequence 1, 2, 4, 12
One possibility: p=[0.833333333333333 -4.499999999999996 8.666666666666661 -3.999999999999996]; polyval(p,1:4) polyval(...

5 years ago | 1

Answered
How to get optimal linear scaling factor for a set of vectors
I want to determine a linear scale factor for each y_raw? vector, such that the mean squared error (MSE) between the average of ...

5 years ago | 0

| accepted

Answered
Linear Equations infinite solutions parametric form
x0=pinv(A)*b; B=null(A); sol=@(c)x0+B*c;

5 years ago | 1

| accepted

Answered
How can I speed up (or avoid) a comparison in for loop?
You might try bwlareaopenn from this submission https://www.mathworks.com/matlabcentral/fileexchange/90762-further-tools-for-an...

5 years ago | 1

Answered
Solver based optimization passing extra parameters
nonlcon=@(x)constraintFcn(x,aa) See also, Passing Extra Parameters - MATLAB & Simulink

5 years ago | 1

Answered
How to get the file names that start with the same letter in the folder?
For example, s=dir('T*_imag.bin'); fileNames={s([s.isdir]==0).name}

5 years ago | 0

Answered
Matrix form for creation and annihilation operator with spins.
Not sure this will help, but if you can write a function that implements the operator, then his File Exchange offering, https:/...

5 years ago | 0

Answered
What should go in a next-generation MATLAB X?
My wish list: (1) Colon operator produces column vectors, not row vectors: x=1:4 (2) Optimization Toolbox solvers should ha...

5 years ago | 7

Answered
combine different size vectors into one matrix
I will assume you have the vectors in a cell array C={[2 3 4 5]; [4 7 7]; [8 8 7 4 2 5]} Then, you can simply do, z=...

5 years ago | 0

Answered
using fsolve function to solve for 2 unknowns
x0 = [80,110]; [sol, Fsol] = fsolve(@problem_one,x0), function F = problem_one(theta) theta3 = theta(1); theta4 ...

5 years ago | 1

| accepted

Answered
fminunc initial point is local minimum, but fminsearch returns reasonable estaimtes
It could happen if your objective function is piece-wise flat (and hence non-differentiable). fminsearch is a derivative-free so...

5 years ago | 0

| accepted

Answered
How can I obtain the Fourier Transformation as a product of matrices?
N = (0:255).'; X = (2*cos(((15.8*pi)/128)*N)) + (3*sin(((27.3*pi)/128)*N)); F=fft( eye(numel(X)), [],1); fX = fft(X); %...

5 years ago | 0

| accepted

Answered
How to plot binary matrix as dots?
imshow(yourMatrix)

5 years ago | 0

Answered
Solving non linear equation "Circle" equations
Because you cannot be certain of an exact 3-way (or n-way) intersection, you need to use a numerical least squares solver like f...

5 years ago | 1

| accepted

Answered
What is the real value of "single(my_variable)"?
So the C code keeps good precission. But, does Matlab? Yes, if by "good precision" you mean up to 7 digits. You can see that ev...

5 years ago | 0

Answered
How to define a constat in function handle?
You mean like this? [a,b,c]=deal(3,4,5); f = @(x,y)a*x.^2+b*y+c Or like this? syms x y a b c f(x,y) f(x,y)=a*x.^2+b*y+...

5 years ago | 0

| accepted

Answered
Steepest descent with exact line search method
n=input("Enter the roll number:"); fobj=@(x) (x(1)-n)^2 + (x(2)-2*n)^2; gradobj=@(x)2*[(x(1)-n), (x(2)-2*n)]; x0=[1 1]; ...

5 years ago | 0

Answered
how to develope loop to save the 'n' elements from the vectors
It is not a good idea to store A(i) in separate variables. You should probably just write your equation in terms of vector opera...

5 years ago | 2

Answered
Taylor series approximation problem
As an example, syms x T=taylor(exp(-x),x,7,'Order',4) fn=matlabFunction(T) fn(3) You can of course find more examples...

5 years ago | 0

| accepted

Answered
how can I call a class in a gui?
I have defined a class TimeData by a script Don't you mean you defined it in a classdef file? The constructor function for a c...

5 years ago | 0

Answered
Trying to supply fsolve with system's Jacobian but receiving error ''check for incorrect argument data type"
It is not clear (from what you posted), why you are using symbolic variable manipulation at all. fsolve is a numerical solver, n...

5 years ago | 0

| accepted

Answered
Rotate Values of Matrix
Use imtranslate() to center the source in the image, then use imrotate() it by the desired angle, then use imtranslate() once mo...

5 years ago | 0

Answered
Get the last for digits as the time this message was sent
Is this what you want? str=char( "!AIVDM,1,1,,A,13cut>1001P:3LRGa`P@jip400S<,0*410002" ) str(end-3:end)

5 years ago | 1

| accepted

Answered
Is it possible to set an upper limit on the step size used by fsolve?
You could try playing with the InitDampling option parameter used by the Levenberg-Marquardt method.

5 years ago | 0

Answered
Am I understanding this correctly?
If by "low" you mean zero and by "high" you mean 255, then yes.

5 years ago | 0

Answered
Not sure why while loop won't run.
balance(1) = 1000; contribution = 1200; interest = 0.0025; M = 2; % month ticker while balance(end) < 500000 ba...

5 years ago | 2

| accepted

Answered
How select data just out from a polygon, considering a constraint
borders=[0,0;0,1;1 1;1 0]; p=polyshape(borders); p=blurHull(p,[0.3,0]); p=blurHull(p,[0, 0.1]); isinterior(p,datas) ...

5 years ago | 0

| accepted

Answered
Creating Matrix Subset automatic.
You should be doing it as follows: S=A([1,4,7],:);

5 years ago | 0

| accepted

Answered
How can I sort vector according to its index?
[vect,ind]=sort(vect,'descend')

5 years ago | 0

Answered
Plotting Phase Plane in Matlab
For example, funx=@(t) c1*exp(-3*t)+c2*exp(-t); funy=@(t) -c1*exp(-3*t); fplot(funx,funy,[0,1]) or t=linspace(0,1,100); ...

5 years ago | 0

Load more