Answered
How to solve 4 non linear equations with 5 unknowns using least square method
There are probably going to be infinite solutions, but you can use fsolve() to find one of them.

4 days ago | 0

Answered
Matlab static variable that can be modified by super class and sub class?
You mean you want all instances of the class and its subclasses to share the same copy of staticvar? If so, you can write the s...

4 days ago | 0

| accepted

Answered
Nested for loop performance speed up
With the data sizes you've shown, the final result D will be a 7GB logical matrix. That seems like a non-starter. If you can red...

4 days ago | 1

Answered
Polyshape rotation without distort
Probably because the data aspect ratio of your plot is not 1. I.e., the scales of your x and y axes are different.

4 days ago | 0

| accepted

Answered
How to split array into sub arrays?
The way you would do this is to convert the vector to a cell array. There is no way to do it without a loop. You can use mat2til...

4 days ago | 0

Answered
Split large vector into smaller vectors based on upper and lower limits
Using this File Exchange submission, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutiv...

4 days ago | 0

Answered
Using parfor eliminates use of multithreading
If you are getting the best performance from the Linux command line, perhaps a solution would be to invoke the Linux command li...

5 days ago | 0

Answered
How do I find the instersection on my plot?
You can use fzero, e.g., fun=@(x)x^2; y=4; x_intersect=fzero(@(x) fun(x)-y,[0,1e6])

5 days ago | 0

| accepted

Answered
running a consensus protocol on a directed graph created my an Adj-matrix
Did you mean to have this? ux(i,1) = ux(i,1) + (x(i,j)- x(i,i)) It's not clear from your original code how you expected to get...

5 days ago | 0

Answered
splitapply doesn't split well into bins
You can use accumarray instead. spltsum=accumarray(dis(valid), cell1areas(valid) , [90,1]);

5 days ago | 0

| accepted

Answered
why my integral is not a numerical value?
f=matlabFunction( bras*ket); phase=1i*integral(f,-2*pi,2*pi)

5 days ago | 0

| accepted

Answered
Creat a loop for Image processing
It is possible: for i=1:69; pic=im2gray( imread(i+".tiff") ); ... end

5 days ago | 0

Answered
fit function does not work correctly
You shouldn't use a custom model when one is unnecessary. It is an important advantage to use one of the built-in models when po...

5 days ago | 0

Answered
method syntax for handle objects
Well, the second syntax is the one you would normally use if the method is intended to return a new, freshly constructed, indepe...

6 days ago | 0

Answered
Why does my nonlinear (exponential or trigonometric) model fit poorly?
Here are the most frequent pitfalls that I see: (1) Bad Data Either the data is too noisy or have too few data points. Garbage...

6 days ago | 1

Answered
Apply the same matrix index to another matrix (bootstrap for matrix processes)
Data=[5 7 3 6 6 9 7 2 4]; indices=[ 2 1 2 3 2 1 1 3 3]; tmp=num2cell(Data,2); ...

6 days ago | 0

| accepted

Answered
Memory increases on GPU while performing modification inplace
reshape() does not result in data copying, but permute() does. It cannot be done in place, because it is reordering the data in ...

6 days ago | 0

Answered
Custom fit to negative exponential
You don't need a custom fit for your model. You can use the exp2 model, Y = a*exp(b*x)+c*exp(d*x) but put upper and lower boun...

6 days ago | 0

Answered
MATLAB not detecting any of my functions from methods
You have a missing 'end' on your plot() method and an extra 'end' on your public methods block.

6 days ago | 0

Answered
Custom fit to negative exponential
Possibly you have to supply a better initial guess. In any case, I would recommend fminspleas (Download) for this problem, which...

6 days ago | 0

Answered
To add rows and columns in the start and at the end for a matrix
Perhaps with padarray https://www.mathworks.com/help/images/ref/padarray.html

6 days ago | 0

| accepted

Answered
Matlab Problem with an Image
A=rgb2gray(imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/763086/image.jpeg')); B=bwareafilt( imbinar...

6 days ago | 0

| accepted

Answered
How do I use multi-parameters in my optimization problem for fminunc?
You can do something like that in the problem-based framework. A=optimvar('A',N,3); x=optimvar('x',1); fun=fcn2optimexpr( ...

7 days ago | 0

Answered
Sparse Array with reshape
Consider downloading ndSparse. FF = ndSparse.sprand( [36, 10,4^3],0.2); TT = ndSparse.sprand([1,10, 4^3], 0.2); Result = spar...

7 days ago | 0

| accepted

Answered
How to replace cell and neighbors that are zero in a matrix with nan
Perhaps as follows: A=[ 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ...

7 days ago | 0

Answered
I have a system with 11 equations and 9 unknowns, how can I solve these equation sets?
See fsolve(), or if you want to put upper/lower bounds on the unknowns then see lsqnonlin().

7 days ago | 0

Answered
Apply the same matrix index to another matrix (bootstrap for matrix processes)
I want to apply to the second column of a matrix X (t=173;k=6)...I have tried data=X(2,indices) but it doesn't work You seem to...

7 days ago | 0

Answered
Large binned matrix reshape
tmp=num2cell(reshape(yourMatrix,200,10,10),[1,2]); result=vertcat(tmp{:});

8 days ago | 0

| accepted

Question


App property blocks with different attributes
I have an appdesigner app whose properties block looks like this: properties (Access = public) guiCanvas ...

8 days ago | 0 answers | 0

0

answers

Answered
fmincon optimize matrices of different size
x1=optimvar('x1',3,3); x2=optimvar('x2',4,4); fun = fcn2optimexpr( @(x1,x2) A1*(x1-A)^2*A1'+ B1*(x2-B)^2*B1' ,x1,x2) ...

8 days ago | 0

| accepted

Load more