Answered
Why is my for loop putting out more values that it should?
Probably because you are running in the base workspace and didn't clear the variables after the last run.

5 years ago | 0

| accepted

Answered
find values in one matrix based on condition applied to another matrix
(eg. find values in B that are less than 10, get indicies, apply it to A and get C) A=reshape(A,numel(B),[]); C=A(B<10,:);

5 years ago | 0

| accepted

Answered
Curve fitting while an unknown variable needs to be determined at each data point
Presently, I am using the fmincon function by defining an objective function to be minimized in the least squares sense. fminco...

5 years ago | 1

| accepted

Answered
conv providing different answers in different versions of Matlab
Better/different multithreading strategies in R2021b, I would guess? It will be impossible to deduce the code changes might have...

5 years ago | 0

| accepted

Answered
Matriz N^2,N^2
N=4; R=toeplitz([4 -1 zeros(1,N-2)]); Id=speye(N); k=toeplitz([1,2, repmat(3,1,N-2) ]); blocks={R,-Id,0*Id}; A1...

5 years ago | 0

Answered
How to assign predetermined values for points of discontinuity
v0 = 10+(-3:0.01:3)*1e-8; v=v0; a_n=(0.01.*(10-v))./expm1((10-v)./10); idx=abs(v-10)<1e-8; v=v(idx); a_n(idx)=(0.01)./(...

5 years ago | 1

| accepted

Answered
How to parallelize many small SVD's on a GPU
SVD doesn't currently appear to be a function supported by pagefun for gpuArray objects Perhaps not for gpuArrays, but it is su...

5 years ago | 0

Answered
Optimize legend command?
For example, plot((0:4).^2); s=string(2); legend("$x^"+s+"$", 'interpreter','latex')

5 years ago | 0

| accepted

Answered
How to convert 2D plot to 3D.
You must select one of the infinite possible 3D extensions that you want and tell us what it is. One possibility: load field0 ...

5 years ago | 0

| accepted

Answered
How to avoid using eval in this case?
Store the numeric result to the UserData property of the button, instead of to individual variables. edit(1) = uicontrol('Style...

5 years ago | 1

| accepted

Answered
Create polyshape with no duplicate vertices, intersections, or other inconsistencies that may produce inaccurate or unexpected results
Perhaps as follows. n=7; %number of vertices pgon=nsidedpoly(n); v=rand(2,1); v=v/norm(v); v=[v*0.3;0.7]; v=v/norm...

5 years ago | 0

Answered
An m-by-n-by-1 image cannot be used as input image in the Fully Convolutional Network FCN ?
I was able to modify the input size in deepNetworkDesigner. No idea what will happen when you try to train it.

5 years ago | 0

Answered
Amend a column vector to a matrix array
it would be unnecessary to fix the length of the array if this could happen and it would be more fluid No, it won't be more fl...

5 years ago | 0

Answered
How to extend exponential fitted line to extrapolate values
xx=linspace(0,85,500); plot(xx,f(xx))

5 years ago | 0

| accepted

Answered
I want to draw dotted line arrow by using quiver. What do I have to do?
For example, load('wind','x','y','u','v') X = x(11:22,11:22,1); Y = y(11:22,11:22,1); U = u(11:22,11:22,1); V = v(11:22,11:...

5 years ago | 0

| accepted

Answered
I have a question: Objective function is undefined at initial point.
It looks like you didn't test your objective function to make sure that it runs error-free.

5 years ago | 0

Answered
If I want to plot arrow in patch, what codes do I have to use? And is there any method by using quiver and patch together?
If I want to plot arrow in patch, what codes do I have to use? This is reasonably popular: https://www.mathworks.com/matlabce...

5 years ago | 0

| accepted

Answered
change imref2d so that image is in center
The reason the output doesn't look like a square is because your tmatrix is wrong, not because of anything else: load 'Simulati...

5 years ago | 0

Answered
How can I extract the indices of a vector that contain values below a threshold?
IndicesBelowThreshold=find(NoiseMetric<ThresholdValue)

5 years ago | 0

| accepted

Answered
How to write a MATLAB code to compute a set of indices from an array?
B = [... 1 0 0.6443 0;... 0 1 2.4082 4.6555;... 0 0.6443 1 3;... 0.4152 0 0 1];...

5 years ago | 0

| accepted

Answered
constrain variables to a set of values
The first thing I recommend is that you use ASU to compute L and the equality constraints in matrix form. You can do that by dow...

5 years ago | 0

Answered
How to loosen equation constaints in my fmincon process?
It doesn't sound like you need to loosen your tolerances. It sounds like you need to tighten them or, more preferably, rescale y...

5 years ago | 0

Answered
advantages of nested functions
Another advantage is that it allows you to store function parameters in handles, see, https://www.mathworks.com/help/matlab/mat...

5 years ago | 0

Answered
How to transform a vector that have "*" to indicate that a number is repeated
A='3*2 1*1 5*10'; C=str2double(strsplit(A,{' ','*'})); B=repelem(C(2:2:end), C(1:2:end))

5 years ago | 0

Answered
Thresholding a CT scan image.
Before implementing the decomposition into tiles, you should probably just try imbinarize(image,'adaptive'), which does somethin...

5 years ago | 1

| accepted

Answered
How to make NaN data an empty entry
It depends on the operation. If you are taking the maximum of each data colum, for example, the NaNs are already ignored, e.g., ...

5 years ago | 0

Answered
How do I measure distance between all pixels in a letter?
load image [i,j]=find(bwperim(A)) distances=pdist2([i,j], [i,j]);

5 years ago | 1

Answered
Remove value question: if previous row -row>+-3, then remove the row in matrix A
A(diff(A)>-3)=[] or A(abs(diff(A))<3)=[]; if that's what you really meant.

5 years ago | 1

| accepted

Answered
Big Data math operations
You could do, [U,S]=svds(A,k); A_reduced=U*S;

5 years ago | 1

| accepted

Answered
Solving an equation where 2 variables are dependant through a table
If T is your table, rho=@(Pq) interp1(T.P,T.rho,Pq); P=fminsearch(@(P) norm( rho(P) - M/ V/ (1-P*k) ), P0 ) ; rho=rho(P...

5 years ago | 0

| accepted

Load more