Answered

How to add an NVCC flag

Downgrade to Visual Studio 2019. See also, https://www.mathworks.com/matlabcentral/answers/2158705-mexcuda-can-t-find-visual-st...

How to add an NVCC flag

Downgrade to Visual Studio 2019. See also, https://www.mathworks.com/matlabcentral/answers/2158705-mexcuda-can-t-find-visual-st...

1 month ago | 0

Answered

starting vector (zero vector) equals lower bounds but gets projected to non-zero vector

This behavior is specific to the interior-point algorithm. As the name suggests, an interior-point algorithm must start at an in...

starting vector (zero vector) equals lower bounds but gets projected to non-zero vector

This behavior is specific to the interior-point algorithm. As the name suggests, an interior-point algorithm must start at an in...

1 month ago | 1

Answered

Finding concave hull around abstract shape

ps = load('matlab_answer_example.mat').new_polyShape1; tic; V=cell2mat(arrayfun(@(i) upsamp(polybuffer(ps,-i)),[0,1],'Unifor...

Finding concave hull around abstract shape

ps = load('matlab_answer_example.mat').new_polyShape1; tic; V=cell2mat(arrayfun(@(i) upsamp(polybuffer(ps,-i)),[0,1],'Unifor...

1 month ago | 1

Question

mexcuda() can't find Visual Studio 2022, but mex() can.

In R2024a, I encounter the following when trying to compile with mexcuda in conjunction with Visual Studio 2022. >> mexcuda -la...

1 month ago | 1 answer | 0

Answered

loading and training an existing network.

previous = load("savednet","net","layers"); net = trainNetwork(data,clabels,previous.net,options);

loading and training an existing network.

previous = load("savednet","net","layers"); net = trainNetwork(data,clabels,previous.net,options);

1 month ago | 0

| accepted

Answered

Interpolate and plot a surface in a rotated coordinated system

I'm not familiar with the FEX submission you used, but I can show how I would do it with this one, https://www.mathworks.com/ma...

Interpolate and plot a surface in a rotated coordinated system

I'm not familiar with the FEX submission you used, but I can show how I would do it with this one, https://www.mathworks.com/ma...

1 month ago | 0

Answered

Find the indices of numbers that occur first

You won't be able to do better than a for-loop over the V(i).

Find the indices of numbers that occur first

You won't be able to do better than a for-loop over the V(i).

1 month ago | 0

Answered

scale/normalize parameter vector for optimization

The transformation is non-differentiable, and probably is not a good idea for Optimization Toolbox optimizers which are smooth ...

scale/normalize parameter vector for optimization

The transformation is non-differentiable, and probably is not a good idea for Optimization Toolbox optimizers which are smooth ...

1 month ago | 0

Answered

I have shifted from lsqnoneg to lsqlin because lsqnonneg does not support additional constraint is it right or wrong choice?

If your lsqlin can solve your problem, then there is usually never any reason to use lsqnonneg. lsqnonneg is for nonlinear least...

I have shifted from lsqnoneg to lsqlin because lsqnonneg does not support additional constraint is it right or wrong choice?

If your lsqlin can solve your problem, then there is usually never any reason to use lsqnonneg. lsqnonneg is for nonlinear least...

1 month ago | 0

Answered

Why is my hamming window and rectangular window values the same for sigma_omega when I make L = 21?

% Set window length L = 21 L = 21; % Generate rectangular and Hamming windows rect_window = window(@rectwin, L); hamming_w...

Why is my hamming window and rectangular window values the same for sigma_omega when I make L = 21?

% Set window length L = 21 L = 21; % Generate rectangular and Hamming windows rect_window = window(@rectwin, L); hamming_w...

1 month ago | 0

| accepted

Answered

How to identify Gaussian type maxima in an image

using imregionalmax i can generate a list of candidate. I wanna check each one now. I may like to filter the one which are non s...

How to identify Gaussian type maxima in an image

using imregionalmax i can generate a list of candidate. I wanna check each one now. I may like to filter the one which are non s...

1 month ago | 0

Answered

transform linear inequality constraints into bound constraints for optimization solvers

Yes, a set A*y>=0 is a cone and so can equivalently be expressed as where are the so-called extreme rays of the cone and are ...

transform linear inequality constraints into bound constraints for optimization solvers

Yes, a set A*y>=0 is a cone and so can equivalently be expressed as where are the so-called extreme rays of the cone and are ...

1 month ago | 0

Answered

Cannot define a cell array of custom classes in function argument validation

classdef Session < handle %SESSION Summary of this class goes here % Detailed explanation goes here properties (Acc...

Cannot define a cell array of custom classes in function argument validation

classdef Session < handle %SESSION Summary of this class goes here % Detailed explanation goes here properties (Acc...

1 month ago | 1

Answered

How to convert two nested for-loops to one parfor loop.

It does not seem advisable to use parfor. Everything in your code is vectorizable. However, here is what a parfor approach could...

How to convert two nested for-loops to one parfor loop.

It does not seem advisable to use parfor. Everything in your code is vectorizable. However, here is what a parfor approach could...

1 month ago | 0

| accepted

Answered

Why can't we define properties on enumerations extending from built-in classes?

I don't know why. I suspect it is for the same reason why builtin indexing and concatenation no longer works when you add proper...

Why can't we define properties on enumerations extending from built-in classes?

I don't know why. I suspect it is for the same reason why builtin indexing and concatenation no longer works when you add proper...

2 months ago | 0

| accepted

Answered

Why did CD folder; give such a goofy error message when I just forgot ()

Because cd apploc is equivalent to, cd('apploc') This is a general thing in Matlab function-calling syntax. For any functio...

Why did CD folder; give such a goofy error message when I just forgot ()

Because cd apploc is equivalent to, cd('apploc') This is a general thing in Matlab function-calling syntax. For any functio...

2 months ago | 1

Answered

moving median with variable window

Anyway, I will be very happy for any hint how to apply robust median filter on my use case, where separate parts of signal shoud...

moving median with variable window

Anyway, I will be very happy for any hint how to apply robust median filter on my use case, where separate parts of signal shoud...

2 months ago | 0

Answered

moving median with variable window

x = rand(1,6) k = [2,3,3,5,3,2]; n=numel(x); J=repelem(1:n,k); I0=1:numel(J); splitMean=@(vals,G) (accumarray(G(:),vals...

moving median with variable window

x = rand(1,6) k = [2,3,3,5,3,2]; n=numel(x); J=repelem(1:n,k); I0=1:numel(J); splitMean=@(vals,G) (accumarray(G(:),vals...

2 months ago | 0

Answered

Minimum CUDA driver version which works with R2024a

The driver version you need is a function of your GPU card. Why not just install the latest one as the error message suggests? ...

Minimum CUDA driver version which works with R2024a

The driver version you need is a function of your GPU card. Why not just install the latest one as the error message suggests? ...

2 months ago | 2

Answered

Modifying arrow length based on intersection with polygon

An alternative to Mike's approach using linexlines2D() from the File Exchange, https://www.mathworks.com/matlabcentral/fileexch...

Modifying arrow length based on intersection with polygon

An alternative to Mike's approach using linexlines2D() from the File Exchange, https://www.mathworks.com/matlabcentral/fileexch...

2 months ago | 1

Answered

Should table Indexing be Faster?

I haven't profiled it, but I would bet that the following line, from @tabular/braceReference b = t.extractData(varIndices); is...

Should table Indexing be Faster?

I haven't profiled it, but I would bet that the following line, from @tabular/braceReference b = t.extractData(varIndices); is...

2 months ago | 1

| accepted

Answered

N-dimension curve fit how to

Perhaps polyfitn will help, https://www.mathworks.com/matlabcentral/fileexchange/34765-polyfitn

N-dimension curve fit how to

Perhaps polyfitn will help, https://www.mathworks.com/matlabcentral/fileexchange/34765-polyfitn

2 months ago | 0

Answered

How to speed up vectorized operations for dynamic programming

This might be a little faster. betaPZtransp=beta*PZ'; tic while err>tol && iter<=max_iter RHS = Ret + reshape(V0*bet...

How to speed up vectorized operations for dynamic programming

This might be a little faster. betaPZtransp=beta*PZ'; tic while err>tol && iter<=max_iter RHS = Ret + reshape(V0*bet...

2 months ago | 1

| accepted

Answered

Is there a meaningful guideline on when to use parentheses vs square brackets vs curly brackets in writing MatLab code?

General If we forget about indexing for the moment, it becomes very simple. Function calls use parentheses, and only parenthese...

Is there a meaningful guideline on when to use parentheses vs square brackets vs curly brackets in writing MatLab code?

General If we forget about indexing for the moment, it becomes very simple. Function calls use parentheses, and only parenthese...

2 months ago | 2

Answered

Chasing what is wrong with 'dual-simplex-highs' in linprog

It doesn't like your super-small Aeq values. load('linprog_test.mat') Aeq(abs(Aeq)<1e-8)=0; linprogopt = optimset('Algori...

Chasing what is wrong with 'dual-simplex-highs' in linprog

It doesn't like your super-small Aeq values. load('linprog_test.mat') Aeq(abs(Aeq)<1e-8)=0; linprogopt = optimset('Algori...

2 months ago | 1

Answered

How to log the data in the workspace without modifying the content of the for loop?

What does "log the data" mean? Do you mean you want to store it to a file on disk, or do you want to store it in some sort of ar...

How to log the data in the workspace without modifying the content of the for loop?

What does "log the data" mean? Do you mean you want to store it to a file on disk, or do you want to store it in some sort of ar...

2 months ago | 0

Answered

whether is imageInputLayer flattened?

No, an imageInputLayer does not reshape the input that it receives, as demonstrated in the following, net=dlnetwork(imageInputL...

whether is imageInputLayer flattened?

No, an imageInputLayer does not reshape the input that it receives, as demonstrated in the following, net=dlnetwork(imageInputL...

2 months ago | 0

| accepted

Question

Accessing network drives from within Matlab

I have two Windows 10 computers running Matlab 2023b on the same network. On one computer, I am able to reach a remote network d...

2 months ago | 1 answer | 1

Answered

How to quantify shape similarity between two vectors.

Perhaps you could use correlation-based similarity? x1 = 0:0.1:10; Y1 = gaussmf(x1,[0.8 5 ]); Y2 = gaussmf(x1,[0.8 3 ]); Y3 ...

How to quantify shape similarity between two vectors.

Perhaps you could use correlation-based similarity? x1 = 0:0.1:10; Y1 = gaussmf(x1,[0.8 5 ]); Y2 = gaussmf(x1,[0.8 3 ]); Y3 ...

2 months ago | 0