Answered
fitting cylinder and including all point
This syntax looks appropriate, model = pcfitcylinder(ptCloudIn,maxDistance) It allows you to specify a maximum distance from ...

5 years ago | 0

Answered
How to show the Graphical Solution Method for an Optimization Problem
All I see in the figure is a contour plot of the objective. If that's all you need, you can use fcontour, e.g., fcontour(@(x,y...

5 years ago | 0

Answered
Add points to N-D meshgrid lookup table
In modern Matlab (at least the past 10 years), there is never a need to use meshgrid for interpolation purposes. The inputs can ...

5 years ago | 0

Answered
How do I subtact two or more functions and integrate them?
clc close all clear all Fs= 2.16*10^-5*pi; % Geometrical Factor for sun Fa=pi; % Geometr...

5 years ago | 1

| accepted

Answered
nearest(100*rand()) does not work
If you're just trying to generate a random integer from 0 to 100, randi([0,100])

5 years ago | 0

Answered
How to turn a curve fit into a function
If I generate a fit wth the FIT function, I am then unable to use that object as a normal function. Sure you can. x=1:5; y=x...

5 years ago | 0

Answered
Plot a rectangle inside of a rectangle.
One way, V=[-1 -1; +1 -1; +1 +1 ; -1 +1]/2; p=[polyshape(V.*[50,20]), polyshape(V.*[15,10])]; plot(p)

5 years ago | 1

Answered
I have a 3D logical matrix represented a segmented spinal volume. I want to export this volume as .obj or .stl for further use. How can I do this?
Use isosurface to triangulate the surface of the spine. Then, use stlwrite, https://www.mathworks.com/help/matlab/ref/stlwrite....

5 years ago | 1

| accepted

Answered
MATLAB's inefficient copy-on-write implementation
(1) The variable must be allocated within a function. A workaround to this rule is to wrap the data in a handle object: a = 1:...

5 years ago | 0

Answered
How do I obtain and plot the outcomes (for changing weights) of a weighted objective function efficiently? (Weight = 0:0.1:1)
This may help, https://www.mathworks.com/videos/pareto-sets-for-multiobjective-optimization-1535999427864.html

5 years ago | 0

Answered
constrain 2 functions to meet in specific point
Are there any other possibility, which let me plot, or fit a function throuh all given known points? That wouldn't be curve fit...

5 years ago | 0

Answered
Divid 3D space into grid of n x n x n
Perhaps this is what you meant A=rand(111,111,111); B=mat2tiles(A,[3,3,3]) % from https://www.mathworks.com/matlabcentral/fi...

5 years ago | 0

Answered
How to access a columns and two or more columns at constat interval and make a sperate matrix?
B=A(:,[1,6,11]); C=A; C(:,[1,6,11])=[];

5 years ago | 0

| accepted

Answered
Using MATLAB Draw the state transition diagram and find the stationary distribution of the Markov chain whose transition matrix is given
P=[0 1/4 3/4; 0 1/2 1/2; 2/5 2/5 1/5]; G=digraph(P); plot(G,'EdgeLabel',G.Edges.Weight)

5 years ago | 0

| accepted

Answered
parfor error with 3D matrix
Move that line outside the loop. parfor ii=1:20 ii for jj=1:10 jj TEST1 (ii,jj,:) = data(ii,jj,...

5 years ago | 0

| accepted

Answered
Why do I receive different answers from the derivative with and without using chain rule?
I think possibly you have to express it in terms of more fundamental functions, syms x y f(x,y) = exp(-1i*x/sqrt(3))*(1+2*exp(...

5 years ago | 0

| accepted

Answered
reading file in objective function optimization
Read the files into Matlab variables before you run your optimization. Make the variables fixed data in your objective function ...

5 years ago | 0

| accepted

Answered
For loop optimization help for working with large data
load('Example Workspace.mat') edges=[seconds( Tagstime-Tagstime(1) );inf]; T=seconds( TEMPX.Time-Tagstime(1) ); bin=disc...

5 years ago | 0

Answered
Truncated SVD returns unexpected 1*1 result
Well, you're multiplying a row vector by a column vector, so a scalar is the only result that is possible. Shouldn't a 1-compo...

5 years ago | 0

| accepted

Answered
How can I plot only the surface within a circle in a 3D animation involving a rectangular grid?
Not sure if the animation this produces is what you expect, but it does look pretty. load inputVariables u(:,:,1)=ampl*exp(-...

5 years ago | 0

| accepted

Answered
How to plot a curve with 3 points?
plot(x,y) will always plot a curve. Whether you have enough points for the curve to have the intended shape is another question...

5 years ago | 0

Answered
How do I plot a 64x64x64 matrix?
You could use volshow().

5 years ago | 0

Answered
Nonlinear constraints in genetic algorithm are not fulfilled
There is nothing ensuring that arbitrary population members in an arbitrary generation will satisfy nonlinear constraints. The f...

5 years ago | 0

Answered
Checking inverse of convolution theorem
You need to use circulant convolution, rather than linear convolution. Also, your fftshift must be applied to the output of the ...

5 years ago | 1

| accepted

Answered
How to Reduce image size and increase size
Here is an example, https://www.mathworks.com/help/matlab/ref/imresize.html#mw_0a904a96-3d99-4878-b28f-cdf6f0d7ca0c

5 years ago | 0

Answered
Why do I get Cannot fit Power functions to data where X has nonpositive values when using the curve fitting tool?
Torsten's idea for an exp1 fit works pretty well. load myfile f=fit(x,y,'exp1'); plot(f,x,y)

5 years ago | 0

| accepted

Answered
Make optimiser more robust to upper and lower bounds
The problem might be due to insufficient or low quality data. The optimizer is therefore relying more on the bounds than the phy...

5 years ago | 0

Answered
Distance between two set of points in space
distances = pdist2(A,B);

5 years ago | 1

Answered
I want to only interpolate shorter amounts of data and leave the longer amounts of NaN not interpolated.
If more than x NaN's in a row, then do not interpolate that chunk of data Using function from here, https://www.mathworks.com...

5 years ago | 0

Answered
How do I extract each value from a column matrix and subsitute in a equation?
Change all of your '*' operators to elementwise operator '.*' res=@(z) reshape(z,1,1,[]); phi = res( comb(1,:) ); theta = r...

5 years ago | 0

| accepted

Load more