Answered
Generate all probability of non repeated combinations of .mat files
names=["One","Two","Three"]; N=numel(names); combs=cell(N,1); for i=1:N combs{i}=num2cell(nchoosek(1:numel(names),i),2); ...

4 years ago | 0

| accepted

Answered
fmincon--How to use multivariable optimization
For such a small number of variables, this is very easy to do with a discrete exhaustive search. Here, I use ndgridVecs (downloa...

4 years ago | 0

Answered
Remove pixel whose value is below given threshold
It is possible to do, but only when the pattern that remains is a rectangular sub-image, e.g., A =[1 1 1 1; 1 6 1 6...

4 years ago | 0

| accepted

Answered
How to revert back to old command line display format for cell arrays
Mathworks tech support says there is no preference setting or workaround. However, I've cooked up the following routine for di...

4 years ago | 1

| accepted

Question


How to revert back to old command line display format for cell arrays
At some point between R2020b and R2021b, there appears to have been a change in the way cell arrays containing row vectors are d...

4 years ago | 1 answer | 1

1

answer

Answered
How to improve my inefficient code?
It would improve things modestly if you just convert all the data to an array from the get-go. It doesn't look like you're explo...

4 years ago | 1

Answered
When I'm using the fmincon function to solve an optimization problem,the optimization result is always near the initial value. How to avoid this situation?
When I'm using the fmincon function to solve an optimization problem,the optimization result is always near the initial value. H...

4 years ago | 0

Answered
I want to delete 5% random Selected Index from array and replace zero at the end MATLAB
load('dataset1') N = numel(dataset1) ; percentageMP=5; size_MP=round(percentageMP/100*N); discard=randperm(N,size_MP); ...

4 years ago | 0

| accepted

Answered
How to obtain the FFT of a 4D image
plot(X)

4 years ago | 0

Answered
Split an array using specific points
More likely you would want to do something like this, y=mat2cell(Y,diiv)

4 years ago | 1

Answered
Rotate 3D (512*512*512 double) matrix
order=[3,1,2]; %example A=permute(yourMatrix,order); A=imrotate(A,30); A=ipermute(A,order);

4 years ago | 0

Answered
How to run a function over a specified set of variables in a table?
The more efficient way would be to write ICC to support two multi-column inputs. Then, process the data in 3 subsets, as below: ...

4 years ago | 0

| accepted

Answered
deleting some of the arrays in a matrix based on a principle
A=reshape(10:10:160,4,4) [M,N]=size(A); [X,Y]=ndgrid(0:M-1,0:N-1); test=@(x,y) y+4*x-12<=-1e-6; %test if x,y is below the...

4 years ago | 0

| accepted

Answered
optimization for min and max values of a parameter
l think it should be a kind of passing variable extra parameter but l dont know how to do it. One way is to use nested function...

4 years ago | 0

Answered
Why does my objective function return complex?
There is no "dbstop if complex", but you can set a conditional breakpoints in your objective function to detect when theany part...

4 years ago | 0

| accepted

Question


Do sfit and cfit objects carry the input x,y,z data? If not, why do they consume so much memory?
Attached is an sfit obejct from a poly33 fit, generated with the cftool app. I am wondering why it consumes so much memory (3.3M...

4 years ago | 2 answers | 1

2

answers

Answered
Linear Model with 4 parameters
Asssuming x and y are column vectors, Q= [x.^0, x, -x.*y, -x.^2.*y,-y]; [~,~,V]=svd(Q,0); coeffs=num2cell( V(:1:4)/V(end)...

4 years ago | 0

Answered
Plotting points around ellipses using values from regionprops (or obtaining the function of the ellipse)
You can use bwboundaries() to get the coordinates of the ellipse boundaries. bwboundaries( imfill(bw,'holes') ) You can then f...

4 years ago | 0

Answered
Curve fitting(toolbox) 3d plot is different when using surf
It looks like you have transcribed the fitted coefficients manually from the display, and only to 4 decimal places. (It also loo...

4 years ago | 0

| accepted

Answered
Down Sample Image by Deleting Alternating Rows & Columns
J=I(1:4:end,1:4:end);

4 years ago | 1

| accepted

Answered
The quadprog does not work as intended when the values in A matrix are very small. Is there any other method to deal with such problem?
I suggest you don't use such small values. Rewrite the problem so that your x(i) are measured in larger units, so that you will ...

4 years ago | 1

| accepted

Answered
Finding all possible combinations of objects
You can use the attached file, w=850-600; A=[3,5,2,7]; Nmax=ceil(w/min(A)); combinations=diophantine(A,w,0:Nmax)

4 years ago | 0

Answered
Save each element from a cell as separate matrix
T=num2cell(tst,[1,2]); [x1,x2,x3,x4,x5,x6,x7,x8,x9,x10]=deal(T{:}); save x x*

4 years ago | 0

Answered
How to vectorize this code and make it efficient?
Perhaps with pcg()? N=3;%3x5 grid desired del = 0.5/(N-1);%Equal spacing between nodes along x and y directions x = 0:del:0....

4 years ago | 0

Answered
Why trust-region-reflective algorithm in fmincon require a gradient as input?
Does the objective function have to be analytical? since my objective function, is function handle that calculates some scalar a...

4 years ago | 0

| accepted

Answered
Tangent line to the edge of binary image
A solution that comes mind is to get rid of smaller blobs and is to extract the (x,y) values of the edges and fit a curve to eac...

4 years ago | 0

| accepted

Answered
Why is one of my subplots being deleted?
Not sure, but I think you're better off using tiledlayout(), tiledlayout(74,1) ax1 = nexttile([64,1]); ax2 = nexttile([10,1...

4 years ago | 0

Answered
Why is this newton raphson outputting the same number? How can I change this?
Well, the equation parameters are not changing in your loop, it seems to me. NR() is just being given the same equation over and...

4 years ago | 0

Answered
Obtaining half-spaces from the convex hull in MATLAB
You can use vert2lcon from https://www.mathworks.com/matlabcentral/fileexchange/30892-analyze-n-dimensional-convex-polyhedra P...

4 years ago | 0

Load more