Answered
How to find the potential that corresponds to some particular (x,y,z) coordinate ?
YOu are doing alright. Just pass to scatteredInterpolant values without NaN ix = ~isnan(x+y+z+c); F = scatteredInterpolant(x(i...

5 years ago | 0

Answered
how do we choose circles and rectangulars
binarize image use imfindcircles I0 = imread('img1.jpeg'); I1 = im2bw(I0); [cc,rr] = imfindcircles(~I1,[50 100]); imshow(I1...

5 years ago | 0

Answered
Calculate radius from scatter plot
Here is the idea scale your data create an image (fill pixels) dilate image to create solid round object (circle) use imfind...

5 years ago | 0

Answered
2D mapping with datapoints from serpent movement.
try this x = [0 repmat([5 5 0 0],1,10)]; y = [1:20;1:20]; y = [y(:)' y(end)]; plot(x,y) axis([-1 6 -1 22])

5 years ago | 0

Answered
Calculate radius from scatter plot
Try density function hist3 r = rand(500,1)/5; t = rand(500,1)*2*pi; x = [rand(50,1); r.*cos(t)+0.5]; y = [rand(50,1); r.*si...

5 years ago | 0

Answered
How can I sketch correctly?
Here is a start try this line to draw the part you are interested in z1 = (x/2+1).^2 + y.^2/4; surface(x/2+1, y/2, z1, 'FaceC...

5 years ago | 0

| accepted

Answered
2D plot from 3D Datasets
try this way zslice = [-20,15]*scaLe; figure slice(XX,YY,ZZ,zi,xslice,[],[]) figure slice(XX,YY,ZZ,zi,[],[],zslice(1)) fig...

5 years ago | 0

Answered
Griddata gives NaN values
I think you are using griddata in a wrong way clc,clear load Xv.mat load Zv.mat load data.txt xx = linspace(min(Xv),max...

5 years ago | 0

Answered
How to connect two scatter 3d plots with lines?
Use plot3 instead of scatter3

5 years ago | 0

Answered
How to plot black line contours on an already plotted contourf plot?
This should be helpfull [x,y,z] = peaks(20); contourf(x,y,z,-6:2:6,'linew',2) hold on contour(x,y,z,[2 2],'r','linew',3) ho...

5 years ago | 0

Answered
I want to know the percentage of a red color and the blue color in an image. Then put the percentage in a circular pie graph. What codes should I use?
Here is the idea use paint to find appropriate colors Play with parameters I0 = imread('Gram_stain_01.jpg'); I1 = double(...

5 years ago | 0

| accepted

Answered
Interpolate to plot contour in plane of non-uniform 3D data
Use griddata to interpolate your data (create 3d matrices) Use slice to create crossection views x = 2*rand(5000,1)-1; y = 2...

5 years ago | 0

| accepted

Answered
crop the polygon from the 3D surface
Here is another idea using triangulation (initmesh) create polygon use initmesh to triangulate it calculate Z coordinate ...

5 years ago | 0

Answered
Extrema of a PointCloud surface
Here is the idea: use griddata to build a surface use imregionlmax to calculate extrema

5 years ago | 0

| accepted

Answered
How to reduce number of points based on proximity to one another
try scatterredInterpolant or griddata x = [rand(100,1); rand(50,1)/5+0.2; rand(50,1)/5+0.5]; y = [rand(100,1); rand(50,1)/5+0....

5 years ago | 1

Answered
crop the polygon from the 3D surface
What about this? I just cutted surface in 2d plane [X1,Y1,Z1] = sph2cart(llambda1,pphi1,6.9); surf(X1,Y1,Z1) in = inpolygon(X...

5 years ago | 0

| accepted

Answered
Contourf(x,y,z) with imported data
You are import data in a wrong way. Try this num = xlsread('WSS Data.xlsx','Normal','C:E'); x = num(:,1); y = num(:,2); z = ...

5 years ago | 0

Answered
Faces of a Cube - Multifaceted Patches Documentation
pretty clear for me clc,clear cla x = [0 1 1]; y = [0 0 1]; patch(x,y,'r') x = [x+2; 1 2 1.5]; % add second row y = [...

5 years ago | 1

Answered
method of lines for coupled fisher kolmogorov pdes
see this example. It should be helpfull

5 years ago | 0

Answered
How to make a function that uses Runge-Kutta Method
Try something like that wp(j+1) = rk4(FW,t,wp(j),h); function u1 = rk4(f,t,u0,h) k1 = f(t,u0); k2 = f(t+h/2,u0+k1*h/...

5 years ago | 0

| accepted

Answered
real time 3D graph update
use pause [x,y,z] = cylinder(20); h = surf(x,y,z); zlim([-2 2]) for i = 1:10 set(h,'zdata',z*sin(i)); pause(0.2) ...

5 years ago | 0

Answered
how to find thermal analysis and heating in a 3D structure
Create surface Convert it to patch using surf2patch example clc,clear % main model [x,y] = pol2cart(deg2rad(-90:10:90...

5 years ago | 0

Answered
Magnetic hysteresis modelling using the Flatley differential equation model
Here is a start function main % code % constants [t,B] = ode45(f,time,B0); plot(t,B) function dB = f(t,B) d...

5 years ago | 0

| accepted

Answered
surface plot figure size with getframe
Use print to save an image with high resolution clc,clear opengl software x = 0:1:10; y = sin(x); h = plot(x(1),y(1),'or');...

5 years ago | 0

Answered
ODE45 using array input
Can you explain what you are trying to do?

5 years ago | 0

| accepted

Answered
minimum distance when a circle is beetween two points
try this script

5 years ago | 0

Answered
Creation of a colorbar with quantized solid block-like colors and 180ยบ rotation of the colobar label
This should be helpfull clc,clear clf h = colorbar('location','north'); set(h,'xticklabel','') txt = {'0' 'pi/2' 'pi' '3*pi...

5 years ago | 1

| accepted

Answered
How to plot to get the figure?
I just used these formulas from this page The code i used clc,clear [x,y] = meshgrid(-3:0.2:3); a = 1; ...

5 years ago | 0

Answered
How to locate a point on an image relative to a reference point from another image?
Use atan2 function ar = atan2(yr,xr); % angle or R point am = ar + m1; % angle of M point [xm,ym] = po...

5 years ago | 1

| accepted

Answered
I am trying to calculate the perimeterof leaf but i'm getting the output as 2.7895e+3 in this way .please check this and correct my code. Thankyou in advance
I'd add imclose to your to clean the image (you have same deffects in it) I1 = imclose(bw,ones(10)); p=regionprops(I1,'Perim...

5 years ago | 0

Load more