Answered
Calculate area under graph between two points
Simple solution: k = 1; thresh = 0; s = zeros(1,100); % how many peaks? for i = 1:length(y)-1 % if a new peak...

7 years ago | 0

Answered
how to store variables in coloum in text file?
I'd use fprintf(): f = fopen('plot.txt', 'wt'); % 'wt' - write file, text mode formspec = '%f %f\n'; % two va...

7 years ago | 1

Answered
The length of the intersection curve between a sphere and a cylinder
It's clear enough to see that all x, y of the curve are belong to cylinder: And z coordinate we can get from sphere equation ...

7 years ago | 1

Answered
fitting rectangle through data points
If your data always has V form (look like triangle). Tree corners can be found. Find farthest corners using pdist2() Use wiki...

7 years ago | 2

| accepted

Answered
solving an equatin... please help me
Also you can try fzero() f = @(a,x) sin(a*x)./x; F = @(a) integral(@(x)f(a,x),0,7)-0.8; % a = fsolve(F,2); % didn'...

7 years ago | 0

Answered
how to middle?
If you have only circle on the image like below clc,clear I = imread('img.png'); I1 = im2bw(I,graythresh(I)); % ...

7 years ago | 0

| accepted

Answered
How to get mean value minute by minute in a vector.
If the frequency is 1Hz then: k = 1; % counter of mean value vector n = length(v); ...

7 years ago | 0

| accepted

Answered
Help with my secant method.
Some suggestions: x0 = 0.5; x1 = 2; fx0 = feval(f,x0); while abs(error) > 1.0E-6 & it_count <= 100 % fx1 = feval(f,2); ...

7 years ago | 0

Answered
Can anyone suggest how can I draw a tangent from a given point in line and get its intercept value on y axis?I
Just use simple equation of a line Accept the answer please

7 years ago | 0

Answered
Find closest non-zero pixel, but only travel through pixels of value zero?
What if just use pythagoras theorem? I = imread('capture2.PNG') [y,x] = find(I(200:300,200:300)); % extracting non-zero pix...

7 years ago | 0

Answered
How can read a particular file pattern and store it in the same pattern?
I'd use loops (not tested) path = 'd:\Studying\matlab\'; % read from dest = 'd:\Studying\SolidWorks\...

7 years ago | 0

| accepted

Answered
Problem with discrete state space equation
Use expm() for matrix exponent (exp() ony returns exponent of each element in matrix): phi = expm(Ts*Ai); gamma = inv(Ai)*(phi...

7 years ago | 0

| accepted

Answered
custom use of heavisde?
How to atomate it? x1 = [1 1 -1 -1 1 1]; x2 = [0 1 1 2 2 3]; y = heaviside(x1); plot(x2,y) xlim([-0.5 3.5]) axis equal

7 years ago | 0

| accepted

Answered
Algorithm for curve smoothing
In this part NewSignal = signal; for i = 2 : length(signal)-1 NewSignal(i,:) = (NewSignal(i,:)+NewSignal(i-1,:)+NewSignal...

7 years ago | 0

Answered
Surf plot 2D diffusion FEA
Try h=surf(X,Y,C); shading interp set(h,'EdgeColor','k')

7 years ago | 0

Answered
Grow lines along path
clc,clear I = imread('bw.jpg'); I1 = im2bw(rgb2gray(I)); % crop black rectangle first [i1, j1] = find(~I1,1,'first'); ...

7 years ago | 0

Answered
Fallen clear plastic bottle detection
Try this clc, clear I1 = imread('111.jpg'); I = rgb2gray(I1); I2 = edge(I); I3 = imdilate(I2,true(3,3)); I4 = bwareaopen(~...

7 years ago | 0

Answered
distance line from a point
But you already have those pixels/points: n = 100; % number of pixels x0 = round( linsp...

7 years ago | 0

Answered
How can I extract a distribution from a 2d histogram?
Look HERE and HERE

7 years ago | 0

| accepted

Answered
How can I get curving points of trapezoid shape in 1d array
I reduced points and find search for angle difference bigger than clc, clear, cla load data.txt tol = 500; t = 1:tol:length(...

7 years ago | 0

| accepted

Answered
Plotting multiple object trajectories together with their identity
I always use simple plot() and pause() to animate something clc, clear, cla load a.mat np = 2; %(size(a,2)-1)/2; % n...

7 years ago | 0

| accepted

Answered
How to get the mouse coordinates in a 3D spherical plot?
If you have x,y,z coordinates use spherical system coordinate: theta is longitude (from equator), phi - latitude Latitud...

7 years ago | 0

| accepted

Answered
How do I plot cylinder bar in matlab?
You can manually create whatever you want clc,clear radius = 10; [X, Y, Z] = cylinder(radius,30); [X0, Y0] = sphere(20); X0...

7 years ago | 0

Answered
How can I match two vectors using the discrete inverse transform method?
Give each element of U and compare with every element of V ind = zeros(size(U)); for i = 1:length(U(:)) [~, ind(i)] = min...

7 years ago | 0

| accepted

Answered
Can anyone explain the following code ?
Ask me something

7 years ago | 0

| accepted

Answered
Predicting lower and upper bounds of coefficients for curve fitting tool.
You can manually experiment with a,b,c clc,clear load X.mat load Y.mat func = @(a,b,c,x) a*exp( -(x-c).^2/b ); opt = fito...

7 years ago | 0

Answered
Calculating pixel difference between different lenses of a camera
Read about cpselect() and fitgeotrans() Ask if needed

7 years ago | 0

Answered
Finding the intersection of a bunch of circles of different centers and radii, using FSOLVE
If circles normally intersect each other they have 2 intersection points - equation for the first circle - equation for the ...

7 years ago | 0

Answered
double derivative of an image
What about manually drawing line? clc, clear I = imread('original image.png'); I = rgb2gray(I); I = im2bw(I); imshow(I) ...

7 years ago | 0

| accepted

Answered
Finding intersection of 2 parabolic curve fits with different y-axes
Just change boundaries for "x" axis variable Qspace= linspace(-0.01,0.04,40); %100 points for line % ... [x0, y0] = polyxpoly...

7 years ago | 0

Load more