Answered
Array indices must be positive integers or logical values. in line 5
Correct the missing space in, fori=1:n;

4 years ago | 0

Answered
2 vectors compare it
I will assume here that the oddity mentioned above by @Dyuman Joshi is an error in the presentation of the example. A=[2 3 4...

4 years ago | 0

| accepted

Answered
Build Matrix from X and Y Coords and Corresponding Values
Generally speaking, if you have a list of (t,f) coordinates with corresponding values a, you can use accumarray, e.g., t=[1,2,3...

4 years ago | 0

| accepted

Answered
Test of whether matrix is Symmetric Positive Definite is giving wrong result when matrix is not symmetric
But when I tried to check if Sk is symmetic positive definite using the method described here in the documentaion: All of the t...

4 years ago | 0

Answered
How to rank 3d matrix across 2 dimensions
Is this (simplified) not what you want? iVars=rand(3,3,5); iNames = {'Var 1','Var 2','Var 3','Var 4','Var 5'}; [~,VarSORT]=...

4 years ago | 0

Answered
Set methods for two interdependent properties in class: how do I avoid infinite recursion?
Here's a possible solution with both properties Dependent. It will avoid the infinite recursion, but as I said above, it's not c...

4 years ago | 0

| accepted

Answered
Split big matrix in many submatrices having same size
What I'm trying to do is to split the matrix to submatrices and then for each submatrix, calculate the median value and store th...

4 years ago | 0

Answered
How can I find the mean of multiple variables in for loop
For example, Arrays={rand(2), rand(3), eye(10), randn(15)} Means=cellfun(@(z)mean(z,'all') , Arrays)

4 years ago | 0

Answered
fminunc : A VERY STRANGE PROBLEM!
If I had to guess, the GPU cannot achieve faster speeds because fminunc requires that you pull the results of GPU computation ba...

4 years ago | 0

| accepted

Answered
Change exact area in binary images from 1 to 0
load BW hole = bwareafilt(~BW,1,'smallest') ; BW=BW& ~imdilate(hole,strel('disk',5)); imshow(BW)

4 years ago | 0

| accepted

Answered
Question of Comparing two vectors
a(a<0 | a>1)=nan; b(b<0 | b>1)=nan; c=max(a,b);

4 years ago | 0

| accepted

Answered
Scaling an image then overlaying data on top of it
[X,Y]=readvars('Center of Pressure Data.xlsx'); Y=-Y; h=imshow(flipud(imread('Overhead View of Human.jpg')),[]); h.XData=[4...

4 years ago | 0

| accepted

Answered
help using matlab solve ga function for optimization of non linear expression
See, Optimize with Nonlinear Constraints Using GA. It should look something like this: x=linspace(0,100,10000); vars = ga(f...

4 years ago | 0

Answered
Best way to speed up (parallelize) a large function that take three large 3D arrays as input
I think you need to extract the local part, like in the following: XI1 = distributed(xi1); XI2 = distributed(xi2); XI3 = dist...

4 years ago | 0

Answered
Assign value to individual components of the complex number
H=complex(10,imag(H)) H=complex(real(H),10)

4 years ago | 1

Answered
Skeletonize 3d cylinders
The key problem is that some of the cylinders are touching other cylinders. For those that don't, we can easily separate them wi...

4 years ago | 1

Answered
How to identify if a string has a pattern ?
And finally, is the a way to simplify a string that has several multiplications inside? If you have the Symbolic Math Toolbox ...

4 years ago | 0

Answered
sort a matrix in a specific way
A = [0.1 0; 0.5 0; 1 0.3; 1 0.7; 0.6 1; 0.1 1; 0 0.9; 0 0.2]; %second matrix ...

4 years ago | 0

Answered
sort a matrix in a specific way
%first matrix A = [0.1 0; 0.5 0; 1 0.3; 1 0.7; 0.6 1; 0.1 1; 0 0.9; 0 0.2]; %...

4 years ago | 0

| accepted

Answered
How do I express optimization variable as ones and zeros in constraints?
You would need to introduce additional binary variables Z: X=optimvar('X',24,4,'Lower',0,'Upper',5,'type','integer'); %origina...

4 years ago | 0

| accepted

Answered
Sparse mesh on a surface plot with dense sampling
Plotting the sparse mesh grid over a mesh-free surface won't help me, I want to be able to do this through the properties of the...

4 years ago | 1

| accepted

Answered
Size of vector of abstract symbolic functions
Perhaps this will clarify: syms a b A(t) B(t) c = [a;b]; C=[A;B]; Ct=[A(t);B(t)]; whos c C Ct Basically, symfuns are alw...

4 years ago | 0

Answered
Populate Cells of Structure Array with Empty Tables
This might be what you want: N=3; C=4; T = array2table(zeros(N,10)); [Struc_Array(1:C).a]=deal(T); Struc_Array.a

4 years ago | 0

Answered
How to create a list of matrices??
As I am used to Python I am quite surprised that I can't do it in a simple and obvious way. cell arrays are a close analogue o...

4 years ago | 2

| accepted

Answered
Add a matrix with two columns into another vector based on conditions
One way, using tables: matrix_2={'A',1; 'B',2;'C',3}; matrix_1={ 'B';'C';'D'}; T1=cell2table(matrix_1,'Var',{'Gene'}); T...

4 years ago | 0

| accepted

Answered
failure in user-supplied fitness function evaluation. GA cannot continue. problem based
The error message is complaining that RS(1,:),RS(2,:), or data(i,12) do not contain real values. You should check.

4 years ago | 0

Answered
How can i find the error in the interpolant
fplot(@(x) cosh(x)-p(x))

4 years ago | 0

Answered
Detect all local minimum and remove them
load x&y k=unique(convhull(x,y)); plot(x,y,'--x', x(k),y(k))

4 years ago | 0

Answered
Efficient way to divide array into tiles
Use this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/115340-block-transposition-permutation-and-reshapin...

4 years ago | 1

| accepted

Answered
How can I make the titles line up?
We don't know what you did to create the subplots. However, if you were to create them with tiledlayout, the titles and figure s...

4 years ago | 0

Load more