Answered

How to add an image to the current axes without replacing existing plots

You can use hold fcontour(@(x,y) (x-50).^2+(y-50).^2,[20,80],'m'); hold on imshow(imread('cameraman.tif')); hold off h=gc...

How to add an image to the current axes without replacing existing plots

You can use hold fcontour(@(x,y) (x-50).^2+(y-50).^2,[20,80],'m'); hold on imshow(imread('cameraman.tif')); hold off h=gc...

10 days ago | 0

Answered

Restart Fmincon Optimization from Checkpoint File

No, unfortunately. Restarting from the last point is probably the best you can do. Although, apart from the interior-point algor...

Restart Fmincon Optimization from Checkpoint File

No, unfortunately. Restarting from the last point is probably the best you can do. Although, apart from the interior-point algor...

10 days ago | 0

| accepted

Answered

Image semantic segmentation dimension layer why not match input and output

Below is what analyzeNetwork gives. Only you know what you want the dimensions of each of your activation maps to be. Tell us at...

Image semantic segmentation dimension layer why not match input and output

Below is what analyzeNetwork gives. Only you know what you want the dimensions of each of your activation maps to be. Tell us at...

10 days ago | 0

Answered

Combining two arrays using a seconds order

number = randperm(10, 10) number2 = randperm(10, 10) I=ismember(number2,number(1:5)); number(1:5)=number2(I)

Combining two arrays using a seconds order

number = randperm(10, 10) number2 = randperm(10, 10) I=ismember(number2,number(1:5)); number(1:5)=number2(I)

10 days ago | 0

| accepted

Answered

How can I calculate the unique centroids along with its radius range ?

load data; threshold=2; %Example input T=sortrows(table(Centroid, Radius),2) Centroid=T.Centroid; Radius=T.Radius; D=pdi...

How can I calculate the unique centroids along with its radius range ?

load data; threshold=2; %Example input T=sortrows(table(Centroid, Radius),2) Centroid=T.Centroid; Radius=T.Radius; D=pdi...

10 days ago | 1

| accepted

Answered

Profile and debug load function

You could pursue your hypothesis by extracting the table from an object, then saving the idnlarx column to its own .mat file. Th...

Profile and debug load function

You could pursue your hypothesis by extracting the table from an object, then saving the idnlarx column to its own .mat file. Th...

10 days ago | 0

Answered

Struct field name with space or special character

Another option is to use dictionaries, which are a bit more similar to structs than tables, e.g. secretID=["Steve Rogers", "Ton...

Struct field name with space or special character

Another option is to use dictionaries, which are a bit more similar to structs than tables, e.g. secretID=["Steve Rogers", "Ton...

11 days ago | 1

Answered

How do I mark all critical points on a graph of a function?

syms x; f=(sin(x)+(1/3)*(cos(5*x))); v=matlabFunction( diff(f) ); f=matlabFunction(f); x=linspace(0,2*pi,1e5); loc=find(g...

How do I mark all critical points on a graph of a function?

syms x; f=(sin(x)+(1/3)*(cos(5*x))); v=matlabFunction( diff(f) ); f=matlabFunction(f); x=linspace(0,2*pi,1e5); loc=find(g...

11 days ago | 1

| accepted

Answered

How do I add transparency to a plot in the Live Editor?

The syntax of giving an RGBA color setting seems to be a very old and undocumented feature, https://undocumentedmatlab.com/arti...

How do I add transparency to a plot in the Live Editor?

The syntax of giving an RGBA color setting seems to be a very old and undocumented feature, https://undocumentedmatlab.com/arti...

11 days ago | 1

Question

Plotting lines with quadruplets R-G-B-Alpha ?

It appears that in recent Matlab, I am able to append a 4th number to the RGB triplet, which appears to set either a transparenc...

11 days ago | 2 answers | 0

Answered

identifying and isolating consecutive numbers

code that will split A into B = [1 2 3 4] C = [14 15] D = [23 24 25] It would be a bad idea to split A into separate variables,...

identifying and isolating consecutive numbers

code that will split A into B = [1 2 3 4] C = [14 15] D = [23 24 25] It would be a bad idea to split A into separate variables,...

12 days ago | 1

| accepted

Answered

Modifying the objective function in order to meet the optimization variable boundaries

If the boundaries are given by simple lower and upper bound vectors lb and ub, you can do, function fun=objective(A,lb,ub) ...

Modifying the objective function in order to meet the optimization variable boundaries

If the boundaries are given by simple lower and upper bound vectors lb and ub, you can do, function fun=objective(A,lb,ub) ...

12 days ago | 0

Question

Where is dlfeval tracing information stored?

When dlfeval() is used to call a function, the computation is traced in such a way as to later allow automatic differentiation v...

12 days ago | 1 answer | 0

Answered

3D image alignment: How to extract rotation angles about "static" x,y,z axes from a 3x3 rotation matrix

Attached is the utility that I use. In alignment with what you are pursuing, the code does assume the rotation matrix is a colum...

3D image alignment: How to extract rotation angles about "static" x,y,z axes from a 3x3 rotation matrix

Attached is the utility that I use. In alignment with what you are pursuing, the code does assume the rotation matrix is a colum...

12 days ago | 0

Answered

Divide circular rings in N angular portions

The problem is that the angular portions do not have the same number of elements That's because the image is discretized into p...

Divide circular rings in N angular portions

The problem is that the angular portions do not have the same number of elements That's because the image is discretized into p...

13 days ago | 1

| accepted

Answered

Error in table row subscript

In what way is this not what you want? Northpopulation = readtable("LN_NEXTGROWTH.csv"); %LN = []; <-----You don't need this ...

Error in table row subscript

In what way is this not what you want? Northpopulation = readtable("LN_NEXTGROWTH.csv"); %LN = []; <-----You don't need this ...

13 days ago | 0

Answered

how can I plot a 3-D helical trajectory

t=linspace(0,18*pi, 3000); plot3(2*cos(t), 2*sin(t), t/pi)

how can I plot a 3-D helical trajectory

t=linspace(0,18*pi, 3000); plot3(2*cos(t), 2*sin(t), t/pi)

13 days ago | 0

Answered

How to calculate spray cone angle?

load Image BW = imfill( bwareafilt(imclose(entropyfilt(im2gray(Image))>4.5,strel('disk',5)),1),'holes'); BW=bwareafilt(~im...

How to calculate spray cone angle?

load Image BW = imfill( bwareafilt(imclose(entropyfilt(im2gray(Image))>4.5,strel('disk',5)),1),'holes'); BW=bwareafilt(~im...

13 days ago | 1

Answered

Array indices must be positive integers or logical values.

fx = @(X) X.^2-1-sin(X);

Array indices must be positive integers or logical values.

fx = @(X) X.^2-1-sin(X);

13 days ago | 0

| accepted

Answered

Compare Elements in 2 Arrays

Gen_Excess=min(Gen_Excess,Batt_cap);

Compare Elements in 2 Arrays

Gen_Excess=min(Gen_Excess,Batt_cap);

14 days ago | 0

| accepted

Answered

Change function name everywhere

There is a Find-and-Replace app on the File Exchange that can recurse through mfiles in a folder structure and replace text: ht...

Change function name everywhere

There is a Find-and-Replace app on the File Exchange that can recurse through mfiles in a folder structure and replace text: ht...

15 days ago | 0

Answered

dlgradient of a subset of variables

This seems to work: X0 = dlarray( [1; 2; 3; 4]*10 ); subset=[2,3]; gradTotal = getGradient(X0) %total gradient gradSubse...

dlgradient of a subset of variables

This seems to work: X0 = dlarray( [1; 2; 3; 4]*10 ); subset=[2,3]; gradTotal = getGradient(X0) %total gradient gradSubse...

15 days ago | 1

| accepted

Answered

A bug? input: 1/0 output: -Inf

Theorem: 1/0 = Inf if and only if 1/0 is also -Inf. Proof: Assume first that 1/0=Inf and let us deduce the implication that 1/...

A bug? input: 1/0 output: -Inf

Theorem: 1/0 = Inf if and only if 1/0 is also -Inf. Proof: Assume first that 1/0=Inf and let us deduce the implication that 1/...

15 days ago | 0

Answered

Can figure numbers be re-assigned?

The only reliable way that I have found, one which avoids copyobj and keeps all the figure formatting, is to save all open figur...

Can figure numbers be re-assigned?

The only reliable way that I have found, one which avoids copyobj and keeps all the figure formatting, is to save all open figur...

16 days ago | 0

Answered

Speeding up this function involving 3D matrix multiplications.

Don't use permute(___,[2,1,3]) to transpose the pages in conjunction with pagemtimes. Use the transposition flags, Z = pagemtim...

Speeding up this function involving 3D matrix multiplications.

Don't use permute(___,[2,1,3]) to transpose the pages in conjunction with pagemtimes. Use the transposition flags, Z = pagemtim...

16 days ago | 2

| accepted

Answered

lsqcurvefit claiming complex-valued function

Because the log of a negative real number is complex, e.g., log(-2)

lsqcurvefit claiming complex-valued function

Because the log of a negative real number is complex, e.g., log(-2)

16 days ago | 0

Answered

cubic spline interpolation - mixed boundary conditions possible?

This FEX download will let you impose conditions like that, https://www.mathworks.com/matlabcentral/fileexchange/24443-slm-shap...

cubic spline interpolation - mixed boundary conditions possible?

This FEX download will let you impose conditions like that, https://www.mathworks.com/matlabcentral/fileexchange/24443-slm-shap...

16 days ago | 0

Answered

How to color Gaussian 3D plot with shiny texture?

[X, Y] = meshgrid(-3:0.1:+3); Z = exp(-X.^2-Y.^2); surf(X,Y,Z,'FaceColor',[0.6 0.1800 0.700],'EdgeColor','none'); light...

How to color Gaussian 3D plot with shiny texture?

[X, Y] = meshgrid(-3:0.1:+3); Z = exp(-X.^2-Y.^2); surf(X,Y,Z,'FaceColor',[0.6 0.1800 0.700],'EdgeColor','none'); light...

17 days ago | 1

| accepted

Answered

Stationary point Code Error. Trying to find stationary points for the equation below. Was having a hard time doing it by hand so tried a code.. getting error for fsolve.

The problem is strictly convex, so obviously the staitonary point is unique and lies at the global minimum. So why not just use ...

Stationary point Code Error. Trying to find stationary points for the equation below. Was having a hard time doing it by hand so tried a code.. getting error for fsolve.

The problem is strictly convex, so obviously the staitonary point is unique and lies at the global minimum. So why not just use ...

17 days ago | 0

Answered

Access to non-public class members

You could move the classdef to an @-folder, either manually or programmatically and either temporarily or permanently. Then, add...

Access to non-public class members

You could move the classdef to an @-folder, either manually or programmatically and either temporarily or permanently. Then, add...

17 days ago | 1

| accepted