Answered
Tangent line to the edge of binary image
A solution that comes mind is to get rid of smaller blobs and is to extract the (x,y) values of the edges and fit a curve to eac...

4 years ago | 0

| accepted

Answered
Why is one of my subplots being deleted?
Not sure, but I think you're better off using tiledlayout(), tiledlayout(74,1) ax1 = nexttile([64,1]); ax2 = nexttile([10,1...

4 years ago | 0

Answered
Why is this newton raphson outputting the same number? How can I change this?
Well, the equation parameters are not changing in your loop, it seems to me. NR() is just being given the same equation over and...

4 years ago | 0

Answered
Obtaining half-spaces from the convex hull in MATLAB
You can use vert2lcon from https://www.mathworks.com/matlabcentral/fileexchange/30892-analyze-n-dimensional-convex-polyhedra P...

4 years ago | 0

Answered
How to plot a 3D plot from three linear vectors?
x=linspace(0,180,100);% 1st vector y=x;% 2nd vector z=rand(1,100)*1e-7;% 3rd vector line(x,y,z); view(3)

4 years ago | 0

| accepted

Answered
How to allign Y axis of a image with out reversing image?
rgb = imread('peppers.png'); h1 = image([-0.5 0.5],[0.7 -0.7],rgb,'AlphaData',1); set(gca,'YDir','normal')

4 years ago | 0

| accepted

Answered
How to create a .mat file with variables
You can use matfile() to alter the contens of a .mat file directly, but it might be easier just to load Fighter.mat, make whatev...

4 years ago | 0

Answered
How to solve MINLP via problom-based optimization
You can use prob2struct() https://www.mathworks.com/matlabcentral/fileexchange/74481-prob2matrices-a-selective-version-of-prob2...

4 years ago | 0

Answered
Start Point option to optimize fit
By default, they will be in alphabetical order, but you can set the order when your provide a custom model with the 'coefficient...

4 years ago | 0

| accepted

Answered
How to make a polar grid with variable number of angular points?
I would use integral2() which, for one thing, does not require you to provide a meshgrid of samples. However, remember that with...

4 years ago | 0

Answered
How can I count the sum of inverse value of each non zero elements of a matrix?
sum(1./nonzeros(x),'omitnan')

4 years ago | 2

Answered
how to add an arrow yaw/pitch/roll on the displacement plot at each time-steps? (an orientation matrix is calculated for each time-steps)
Perhaps using quiver3()? You could use hold on and hold off to add additional arrows to each (x,y,z) point.

4 years ago | 0

Answered
How to generate M *almost* mutually orthogonal vectors of dimensionality N, where M>>N ?
One way to pose that mathematically is to solve the minimization problem, where is the MxM identity matrix. Her...

4 years ago | 4

| accepted

Answered
Regrid data from 2x2 to 1x1 resolution
Don't read in the imported data as a table. Read it in as a matrix.

4 years ago | 0

Answered
How to find projection on a set
The set appears just to be a box, so, lb=[100;100;100]; ub=[150;150;200]; P= @(x) min( max(x(:),lb) ub);

4 years ago | 0

Answered
Is there a way to search for function calls recursively without running the program?
Perhaps this will be of some help, https://www.mathworks.com/help/matlab/matlab_prog/identify-dependencies.html#responsive_offc...

4 years ago | 0

Answered
Fit an ellipse to data.
If you have the Computer Vision Toolbox, you can do outlier rejection with ransac() in conjunction with any ellipse-fitting rout...

4 years ago | 1

Answered
Alternate way of defining given function using function handle for fmincon
Gather the into a 4x4 matrix H and A,B,C into an unknown 4x3 matrix X. Then write the problem as, %X=[A,B,C] %H=[h1,h2,h3,...

4 years ago | 0

| accepted

Answered
What is the problem here to run this code? Can I run this code without using fsolve?
x0=[0,0]; x=fsolve(@ex_sys_n,x0) function fn=ex_sys_n(x); fn(1)=exp(-x(1)+x(2))-x(1)^2; fn(2)=sin(x(1))+cos(x(2)); en...

4 years ago | 0

| accepted

Answered
How do you avoid unnecessary copies when modifying table objects?
I think adding and removing columns from tables is largely like adding/removing elements from cell vectors, i.e., it involves no...

4 years ago | 0

| accepted

Answered
Does MATLAB have import statements in the scope of a class?
The only thing that comes to mind is if you nest the actual implementations of all your methods (or at least those that will use...

4 years ago | 0

Answered
Plotting three planes and their intersections
First, you must compute the lines of intersection. Then you can use the line() command to add them to your plot.

4 years ago | 0

Answered
How do i fit a rotated ellipse to my data in MATLAB
Use ellipticalFit() in, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for-fitting-conics-and...

4 years ago | 0

| accepted

Answered
How to attribute intersection points between poly and lineseg to poly
num_frames_in = size(in,1) %count num elements/frames in polygon num_frames_out = size(out,1) %count num element/frames outside...

4 years ago | 0

Answered
Is it possible to speed up regionprops function?
What are the dimensions of the images? Perhaps you could downsample them. Additionally, you might try reading the images into t...

4 years ago | 0

Answered
How to add border to graph
I have tried using box on; box off; option. Do not use box off. That will remove the border.

4 years ago | 2

| accepted

Answered
I am trying to solve fsolve (multi-variable) but getting an error.
By choosing a=1, you are dividing by 1-a=0 for any input value, u. f(0), f(1), f(2) function fval = f(u) d1=1; ...

4 years ago | 0

| accepted

Answered
How to prevent Matlab from rounding off a column to zero?
You could use format long. Or, since it's just for display purposes, you can display it as a table,e g. A=(1:5)';A=[A,1e10*A] ...

4 years ago | 0

| accepted

Answered
Created a class fucntion but I am not able to find output for certain conditions even though the value exists.
Tsk, tsk. You should know better than to test for exact equality with floating point values. >> obj.energy(591) ans = ...

4 years ago | 0

| accepted

Answered
Is there something similar as splitapply that works on a data table instead just on one value?
Tex=varfun(@(x){table2array(x)},tex,'InputVariables','Data'); out = varfun(@(z)max(cell2mat(z)), Tex,'InputVariables','Data',...

4 years ago | 0

| accepted

Load more