Community Profile

# Matt J

##### Last seen: Today
6,882 total contributions since 2009

Professional Interests: medical image processing, optimization algorithms

View details...

Contributions in
View by

Circulant Matrix [Column Wise Traversal]
function C= circulant(x) n=length(x); C=zeros(n,n); C(1,:)=x; for i=2:n C(i, :)=[C(i-1, n) C(i-1,...

20 hours ago | 0

There's never any gaurantee parfor will be faster, but I would modify the code as follows, B_Data=A_Data(:,2:5)/(0.6*2); B_ref...

20 hours ago | 0

Use inpolygon command for multiple polygon areas
Use discretize(), https://www.mathworks.com/help/matlab/ref/double.discretize.html Apply it separately to all of your xv's and...

24 hours ago | 0

For loop and array type
Best guess - your loop has reached a z for which allcsvfiles{z,1}(:,4) contains text. Use dbstop() to check.

24 hours ago | 0

Array of Structures (not structure array)
I don't know if this is something you explored in (2), but if so, I don't see why it wouldn't cover what you are trying to do. ...

1 day ago | 0

Memory cost of multiplying sparse matrices
Here's another customized multiplication routine for tall A. I do not know how it compares to Bruno's in terms of speed, but it ...

3 days ago | 0

Memory cost of multiplying sparse matrices
I believe it is simply because Matlab sparse matrix routines don't handle very tall & thin matrix dimensions very well. It beco...

4 days ago | 0

| accepted

Question

Convert a string array to a cell array of strings
Starting with a cell array of strings, >> C={'person','woman','man','camera','TV'}; I know that it is possible to convert to ...

5 days ago | 1 answer | 0

### 1

Splitting a binary image into 2 parts
There is a small break in the curve which I assumed was supposed to indicate the desired dividing point between the right and le...

5 days ago | 0

| accepted

Plotting 3D network of points and their error ellipsoids
You can use scatter3() to plot the points and ellipsoid() to overlay ellipsoids around them. https://www.mathworks.com/help/mat...

5 days ago | 0

| accepted

fminsearch for existing simulation
As Walter said, fminsearch does not know or care how many lines of code are used to implement your objective function. Bear in m...

5 days ago | 0

How to set 2 constrain bounds at the same time?
lb=[-10,-30]; ub=[+10,+30];

5 days ago | 0

| accepted

Is convhulln function work for N dimensional
The points you are inputting to convhulln do not form a solid shape in R^5. To within numerical precision, they all lie on a lin...

5 days ago | 0

Sum each page of a 3D matrix and append sums as rows of new 2D matrix
D=permute(sum(C,1),[3,2,1])

6 days ago | 1

| accepted

Intlinprog function - problem
The optimal solution of a linear program can be discontinuous as a function of the problem data, particular when you have intege...

6 days ago | 1

| accepted

matrix manipulation and transposing
Because when v is a column vector and theta is a row vector, you get implicit expansion, https://blogs.mathworks.com/loren/2016...

6 days ago | 0

How can I create matrix with parameter?
It seems like the kind of thing you would want a function for, rather than a matrix. RecoilEnergy=@(E,r) r.*(r<=E./(1+M./(2*E))...

6 days ago | 0

| accepted

Mean of a field of a struct
C=struct2cell(rmfield(S,'name')); A=cell2mat(reshape(C,1,4,[])); Averages = reshape( mean(A,1),4,[]).'

6 days ago | 0

How create a cell array
It might be beter to have a struct, strArray=["scenario base","perturbazione veicoli","perturbazione strada","perturbazione ped...

6 days ago | 0

How create a cell array
reshape( num2cell((1:24).'*ones(1,150)) ,[],1)

6 days ago | 0

| accepted

How to assign array values to object.object.property at once using deal?
No, you would have to do it in 2 steps, [Variables.Value] = deal (Data(:)); [SimIn(:).Variables] = deal (Variables);

6 days ago | 0

| accepted

Loop for square matrix
The FGETL command might be useful, https://www.mathworks.com/help/matlab/ref/fgetl.html?s_tid=srchtitle#br4x18h-6

6 days ago | 0

| accepted

Can't use mtimesx, "A C/C++ compiler has not been selected"
Run mex- -setup from the Matlab prompt, >> mex -setup and select one of the available compilers.

7 days ago | 0

| accepted

how to find the position of the max componunt
Call max() with two output arguments and only input the columns you are interested in getting the max for, [maxvalue, maxlocati...

7 days ago | 0

continuous representation (image generation) of discrete data set
You can use griddedInterpolant() if your x,y are gridded sample locations, or else scatteredInterpolant().

7 days ago | 0

Using For loop to determine if a number is prime
To determine if a number n is prime, you have to check every number up to and including sqrt(n) and see whether that number is ...

7 days ago | 0

Finding optimal coefficients while fitting multiple data in matlab
If they all follow the same model, just concatenate the 3 data sets and fit them as a single set. If each data set has a differ...

7 days ago | 0

Why does the the f vector in a linear equation always consist of negative values?
Well, I've never heard of simlp, but many solvers, such as linprog() will only solve minimization problems, so if you have an ob...

7 days ago | 1

| accepted

Efficient matrix multiplication for large sparse matrices stored as sparse column vectors
Note that I have little flexibility in the way these matrices are stored, since other parts of my code rely heavily on this. Th...

9 days ago | 1

| accepted