Answered
3d Plotting a decagonal pyramid
sidelength=10; height=8; %User inputs V=nsidedpoly(10,'Side',sidelength).Vertices; V(end+1,3)=-height; trisurf( dela...

2 years ago | 0

| accepted

Answered
How to compute the Volume of a 3D-model
Try lowering the alpha radius and see if it improves the result.

2 years ago | 0

Answered
A and I are n*n matrix. I want to know the code to calculate the photo`s matrix
A=ones(2); n=length(A); N=5; Ac=cell(1,N); Ac{1}=eye(n); for i=2:N Ac{i}=A*Ac{i-1}; end Ac{N+1}=zeros(n)...

2 years ago | 1

| accepted

Answered
Plot function of two variables in 2D space
V = @(x1,x2) x1.^3 + x2.^2; fcontour(V,[0,1])

2 years ago | 0

Answered
How Do I Create a Mean Filtered Image using For Loops?
grayImg=reshape(1:49,7,7) [m,n]=size(grayImg); dm=repmat(3,1,ceil(m/3)); dm(end)=dm(end)-(sum(dm)-m); dn=repmat(3,1,ceil(...

2 years ago | 0

Answered
Solving systems of equations graphically and finding where they cross.
x_intersect=fzero(@(x) 2*x-3*sin(x)+5 ,[-20,+20])

2 years ago | 0

| accepted

Answered
Goodness of fit parameters seem to be incorrect in Curve Fitter App with Exponential 2 term
RSquared is showing as 1, although my hand calculation suggests 0.99993 Not mine. See below. If I had to guess, you copied the ...

2 years ago | 1

| accepted

Answered
Use of fmincon with nonlcon inside a parfor loop
Move the steps inside the loop to its own function doOptimization(). You can nest functions there, as in in the example below. ...

2 years ago | 0

| accepted

Answered
Trying to find chekerboard points, not returning any points with detectCheckerboardPoints
You can download pgonCorners, https://www.mathworks.com/matlabcentral/fileexchange/74181-find-vertices-in-image-of-convex-polyg...

2 years ago | 0

| accepted

Answered
Given vector with N entries, generate all combinations with K entries such that K > N, vector entries can repeat
Starting with R2023a, syms a b k=4; v=repmat( {[a,b]},1,k); result=table2array(combinations(v{:}))

2 years ago | 0

Answered
Given vector with N entries, generate all combinations with K entries such that K > N, vector entries can repeat
syms a b k=4; [C{k:-1:1}]=ndgrid([a,b]); result=reshape(cat(k+1,C{:}) ,[],k)

2 years ago | 1

| accepted

Answered
fmincon: optimize till nonlinear condition is false
Adjusting the constraints shall not be the solution for this. Instead of a hard constraint, you could add a penalty term to you...

2 years ago | 0

Answered
fmincon: optimize till nonlinear condition is false
yes but I maybe could define a maximum stepsize which might be smaller than this intervall so the optimizer cannot accidentally ...

2 years ago | 0

Answered
access time of data in cell array vs matrix
Because extracting from cell arrays involves no new memory allocation. And because N_img=1000 is still very small.

2 years ago | 1

Answered
Poor results for neural-network based image segmentation
Maybe increase the fitting capacity of the network. Add another encoder/decoder layer and/or increase the filter size?

2 years ago | 0

Answered
Poor results for neural-network based image segmentation
I can't manually chop off the appendages via image erosion bwlalphashape from this FEX download, https://www.mathworks.com/mat...

2 years ago | 0

| accepted

Answered
How to avoid recursion in property set functions
The recursion can be avoided if all of the code leading up to the property assignment, along with the property assignment are al...

2 years ago | 0

| accepted

Answered
4D integral using integral and integral3
f = @(a, b, c, d) a+b+c+d; I = @(a, b, c) integral(@(d) f(a, b, c, d), 0, 1,'ArrayValued',1); f2=@(a, b, c) I(a,b,c)+1; I2=in...

2 years ago | 0

| accepted

Discussion


Implicit expansion for CAT()
Would it be a good thing to have implicit expansion enabled for cat(), horzcat(), vertcat()? There are often situations where I ...

2 years ago | 2

Answered
3D hexagonal mesh grid
V=nsidedpoly(6).Vertices; [X,Z]=ndgrid(V(:,1),0:3); [Y,~]=ndgrid(V(:,2),0:3); scatter3(X(:),Y(:),Z(:)); view(-60,70) xla...

2 years ago | 0

| accepted

Answered
A compact way to replace zeros with Inf in a matrix
Allso just for fun. A = [0 3 2 5 6; 1 1 4 3 2; 9 0 8 1 1; 5 9 8 2 0; 3 1 7 6 9]; A=A+1./(A~=0)-1

2 years ago | 3

Answered
How can I populate the rows of a difference matrix without using a for loop?
X=X(:); Y=Y(:); x=reshape(x,1,1,[]); y=reshape(y,1,1,[]); d=hypot( X - x , Y - y ); Diff=@(U,u) ((U(1)-u)./d(1,1,:)) ...

2 years ago | 0

| accepted

Answered
Converting 3D matrix to 2D matrix image
See rgb2gray or im2gray.

2 years ago | 0

| accepted

Answered
Can you help me design a Cylindrical Conical Helix
u=linspace(0,1,30); v=linspace(0,2*pi,30); [u,v]=meshgrid(u,v); x=(1-u).*(2.5+cos(v)).*cos(4.*pi.*u); y=(1-u).*(2.5+cos(v))....

2 years ago | 0

| accepted

Answered
How can I adjust the space between each subplot for a 5*3 subplots setup?
n=4; %1x4 figure; t=tiledlayout(1,n,'TileSpacing','tight'); for i=1:prod(t.GridSize) nexttile imagesc(phantom(12...

2 years ago | 0

Discussion


Do Reinvent the Wheel
Are there Matlab features which intend to satisfy your needs but fail in certain critical areas, forcing you to abandon them com...

2 years ago | 3

Answered
Can you help me design a Cylindrical Conical Helix
For example, t=linspace(0,20*pi,6000); R=exp(-0.1*t); x=R.*cos(t); y=R.*sin(t); z=R.*cotd(30); plot3(x,y,z)

2 years ago | 0

Answered
I cant find MLP-Mixer in MATLAB.
Maybe you can import it into Matlab from this pyTorch repository, https://github.com/lavish619/MLP-Mixer-PyTorch

2 years ago | 1

Answered
MATLAB refuses to display blue in converted JPEG image: is showing singular blue pixels
Make sure that you, (1) Use the same caxis in both image displays, (2) Convert to double first, then divide by 255. Not the...

2 years ago | 0

Answered
How can I adjust the space between each subplot for a 5*3 subplots setup?
The subaxis function in this FEX download https://www.mathworks.com/matlabcentral/fileexchange/3696-subaxis-subplot?s_tid=srcht...

2 years ago | 0

Load more