Réponse apportée
Find the intersection of a square pixel with a closed 2D curve
Doesn't consider below case (use intersect() if it matters to you): Only when nodes inside our outside (base on inpolygon()) ...

environ 7 ans il y a | 1

Réponse apportée
Anyone have any tips to improve my code for findpeaks() so that I get only the first big peaks for each graph like those in transducers 10,13 and 1 but only one of them per graph? I want the first arrival time. Thanks.
If you want first peak use locs(1) If you want max peaks use max() If you want a few maximum peaks use sort() Did i understan...

environ 7 ans il y a | 0

Réponse apportée
How to solve a system of two non-linear equations symbolically
Use matlabFunction() to make function handle from symboliv expression L0 = matlabFunction(L0); L1 = matlabFunction(L1); A = 0...

environ 7 ans il y a | 0

Réponse apportée
Solving for ball trajectory with quadratic drag
'What I've noticed is that positions x,y,z don't even appear in my equations, so they are not used inside the function dxdt.' I...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Helping to create animated wrapping line on a torus
Read about surf() and meshgrid() to plot torus Simple example for animation (actually it's just drawing new object in time) Re...

environ 7 ans il y a | 0

Réponse apportée
Aircraft wing fuel tank modelling
Another way: Calculate the volume of a tank at some control levels % schematic algorithm if V < V1 Y_fuel ...

environ 7 ans il y a | 0

Réponse apportée
How to calculate the distance, in pixels, between each centroid in a binary image.
pdist2 finds distances between every point (every possible combinations. Zeros in matrix means distance to points themselves) ...

environ 7 ans il y a | 1

Réponse apportée
How to find the boundary points in one direction
What if just find() indices where x > 0.95?

environ 7 ans il y a | 1

| A accepté

Réponse apportée
I know a certain y1 and I want to find the respective x1.
I'd use polyxpoly or intersections x = linspace(0,10,20); y = sin(x); y1 = 0.6; % find x at y=0.6 ...

environ 7 ans il y a | 0

Réponse apportée
ode23 , matrix equation , 2nd order DE
You can find roots for x'', y'' and dtheta'' every iteration solving matrix equation function du = func(t,u) u1 = u(1:3)';...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
How to connect lines in a skeletonized image with arcs
Use bwmorph() to find branch points. I sorted them in counter clock-wise order: Find distance and center between neighbor poi...

environ 7 ans il y a | 0

Réponse apportée
Find the set of 3d data parrallel to the current 3d data
Choose some points (P1,P2,P3) from your data - vector of the first line (blue) - some temporary vector between P2 and P3 poi...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
How do I select the pixels outside my region of interest?
m = size(I,1); % number of rows n = size(I,2); % number of columns R = 100; % radius region [X,Y] = meshgrid(...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
How to avoid painting outside the figure using linewidth
Use axis([xmin xmax ymin ymax])

environ 7 ans il y a | 0

Réponse apportée
How to get selected faces in a plotted 3D geometry
Try to change

environ 7 ans il y a | 0

Réponse apportée
2DOF Harmonic Oscillator - Is this right? (How would I do this with ODE45?)
What about ode45? % x(1) == xs % x(2) == dxs % x(3) == xm % x(4) == dxm % fun = @(t,x) [ Vs; d2xs; Vm; d2xm ]; fun = @(t,x...

environ 7 ans il y a | 0

Réponse apportée
Solving system of non linear equations of oscillating mechanism on ODE45
There is something wrong in your (3) equation. I'd first express (4), (5) and (6) like: And substitude it into (3): ...

environ 7 ans il y a | 0

Réponse apportée
Calulate width of every boundary point to majorAxisLength
Just count pixels in vertical direction with sum() I = imread('image.png'); I1 = im2bw(I); % binary image h ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
How to simulate an ODE when one of the parameters is a function of time
Read how to Pass Extra Parameters in help ode23: sol = ode23(@(t,x)Eq(t,x,par),[0 Tfinal],x0); % solving the model Passing tra...

environ 7 ans il y a | 0

Réponse apportée
Numerical integral over the whole spherical volume of a crystallite
Suggestion: Use integral or trapz

environ 7 ans il y a | 1

Réponse apportée
Numerical integration with many parameters.
You forgot about element-wise operator delta=1-Mycp./100; Look also for VECTORIZE

environ 7 ans il y a | 1

Réponse apportée
Why doesn't this code rotate and transform the spiral?
Because you have to mulptiply each set of point separately ptsNew = zeros(size(pts)); for i = 1:1000 ptsNew(:,i) = mTrans...

environ 7 ans il y a | 0

Réponse apportée
how to calculate a ellipsoid arc and project it onto a plane?
I'd build a plane through 3 points (X,Y for plane surface and for ellipsoid surface must be the same) C = contour(X,Y,Zp-Zs,...

environ 7 ans il y a | 0

Réponse apportée
Generate a multiplicative cascade process
Probably should think about initial m, w, z m = 0.2; z = rand; w = rand; syms x y = -x-z-w+1; eq = x^2+y^2+z^2+w^2 -m; ...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Heat map visualizing touch pressure on smartphone in x-y space
I did my best, please like it

environ 7 ans il y a | 1

| A accepté

Réponse apportée
solving a system of ODE
Function looks okay except f/u1. Has to be (as instruction says): ydot = [(ps - p)/d + ppval(f,t))/u1 ... Read about ode45. Ma...

environ 7 ans il y a | 0

Réponse apportée
3D human body for temperature analysis
A lot of work has to be done clc,clear [x, y, z] = cylinder; surf(5*x,5*y,20*z*(1-0.5)) % main body hold on surf( z*7+2,x,...

environ 7 ans il y a | 1

Réponse apportée
How can I plot elliptical pressure distribution
You mean surface or pcolor? [x,y] = meshgrid(-5:0.5:5); Pmax = (3*N)/(2*pi*a*b); pn = Pmax*sqrt(1-(x/a)^2-(y/b)^2); surf(x,y...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
How can I change what information is displayed when clicking on figure elements?
Try to change

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Distance difference from center
I did this xyz0 = (mean(xyz)+mean(abc))/2; % O point XYZ0 = repmat(xyz0,size(xyz,1),1); % duplicate...

environ 7 ans il y a | 0

| A accepté

Charger plus