Answered
Solving a system of PDEs with non constant coefficients and dirichlet and neumann boundary conditions
If your equations change in direction only they are ODE (ordinary differential equations) Is it possible to solve this kind of...

6 years ago | 0

| accepted

Answered
How do I cut a surface in Matlab plot?
Do you have a contour? Green line? [x,y,z] = peaks(20); % some contour data data = [-0.3907 1.5591 -1.8039 0....

6 years ago | 1

Answered
How to find the first value coordinate(the minimum non-zero x coordinate) in each row?
Try this a = zeros(size(A,1),1); for i = 1:length(a) a(i) = find(A(i,:),1,'first') end

6 years ago | 0

Answered
cropping an image using centroids
Try this A = imread('image.png'); I = im2bw(A,0.1); % binarize image [L,n] = bwlabel(I); % label image f...

6 years ago | 0

| accepted

Answered
How to create cuboid with known parameters?
Plot cube as a surface [x,y] = meshgrid([-1 -1 1 1 -1],[-1 -1 1 1]); z = x*0-1/2; z([6 7 10 11]) = 1/2; surf(x/2,y/2,z) axi...

6 years ago | 1

Answered
How to get the cross-sectional area of a PDE model
See this solution f1 = stlread('Cylinder.stl'); [y,z] = meshgrid(-2:2); % meshgrid for plane h = surf(y*0+2,y,z...

6 years ago | 0

| accepted

Answered
How to make an angled line in a meshgrid
Here is an idea: create 4 points (corners of your rectangle) and some background x = [...] y = [...] A = ones(50); % b...

6 years ago | 0

| accepted

Answered
How to find mean value for the row with the same variable?
Try this k = 0; i1 = 1; A = [A; nan nan]; for i = 1:size(A,1) if A(i,2)~=A(i+1,2) % search for an end o...

6 years ago | 0

Answered
Plot contours from coordinates as a line
Solution separate each data using logical indexing order data using angle clc,clear s = load('xycontours.txt'); x = s(:,1...

6 years ago | 1

Answered
how to interpolate each column of a matrix 100X133 using a different index for each column
Try this idx1=[45; 49; 51; 47; 47; 48; 53; 46; 42; 48; 47; 41; 41; 46; 46; 52; 47; 46; 48; 47; 46; 48; 45; 40; 49; 47; 4...

6 years ago | 0

Answered
Fill out Plot between V_Out1 and V_Out3
flip the data xx1 = [t1 flip(t1)]; yy1 = [V_Out1 flip(V_Out3)]; xx2 = [t2 flip(t2)]; yy2 = [V_Out4 flip(V_Out6)]; patch(xx1...

6 years ago | 0

Answered
Replacing for loop with matrix math to increase computational efficiency.
You can increase for loop step You are overwriting same values all the time. THere is no need of it

6 years ago | 0

Answered
How to calculate Area of overlapping polygons inside square
What about this simple trick? I = imread('image.png'); I1 = imcrop(I, [70 75 130 95]); I2 = im2bw(I1,0.95); imshowpair(I1,I2...

6 years ago | 0

Answered
Need help with nested for loop
try bsxfun altitude = [100 150 200 250 300 350]; %Altitude calculations based on Elevation angle El_angle = [0 pi/90 pi/45 pi...

6 years ago | 0

Answered
Importing data from multiple sheets
Use for loop B = []; for i = 1:50 A = readmatrix('data.xlsx',i); B = [B A(:,1)]; end

6 years ago | 1

| accepted

Answered
Mesh removal, so only the deer is visible
Here is an idea: i created lines with meshgrid and rotated them plotted the lines and saved an image having two images (orig...

6 years ago | 0

| accepted

Answered
Using quiver to vary magnitudes of the vector
but the problem is that the result plotted isn't tangent to the stream Why did you change dy and dx order here? f = quiver(xx,...

6 years ago | 0

Answered
How to set specific contour line color/style using contourf?
Use contour again hold on contour(x,y,z,[150 150],'y','linew',2) hold off

6 years ago | 0

| accepted

Answered
Replace unwanted voxels with nearest neighbor labeled values
Solution lab = lab_superior; % the data shared elec = zeros(size(lab)); elec(lab==20)=1; % select electrodes BB =...

6 years ago | 0

| accepted

Answered
How to use splitapply function to find a mean value for part of plot ?
try round y1 = round(y-min(y))+1; % make all yy values 1 2 3 4 ... n = max(y1); % highest number a = zeros...

6 years ago | 0

Answered
Project the areas on the 3d model(car)
Here is a simple example. Should be heplfull clc,clear [x,y,z] = sphere(30); ix = x > 0; % select half of t...

6 years ago | 0

| accepted

Answered
Meshing a 2D contour plot
Use initmesh clc,clear x1 = [0 5 5 0]; % rectangle y1 = [0 0 3 3]; [x2,y2] = pol2cart(0:....

6 years ago | 1

| accepted

Answered
How to plot an arc shaped figure?
Try this t = linspace(0,pi,500); x = cos(t).*(1 + 0.1*cos(30*t) + 0.05*sin(100*t)); y = sin(t).*(1 + 0.1*cos(30*t) + 0.05*sin...

6 years ago | 0

Answered
How to remove the selected points and plot into a new figure?
use logical operators ix = x < 0 & y > 0; scatter(x(~ix),y(~ix))

6 years ago | 0

Answered
detect a moving liquid distance with the time
Have you figured out how to read all pictures? binarize image and use find [ii,jj] = find(A); % find all pixels jj(end)-jj...

6 years ago | 0

| accepted

Answered
Measure width of rectangular object
Here is an idea: binarize image imclose image to get solid region use for loop and imline to create several lines. Use crea...

6 years ago | 0

Answered
Generating voxels for stl files
First you need to separate each region of interest (try clusterdata or kmeans) Once you separate each blob generate pointclo...

6 years ago | 0

Answered
How to integrate discrete values over a known x, y coordinate image
Here is the idea % calculate increments dx = x(2)-x(1); dy = y(2)-y(1); % assume A is your image % assume X and Y are your ...

6 years ago | 1

| accepted

Answered
How do I print values to console selected in a plot?
try this [~,ix] = pdist2([a1,b1], data(:,1:2)); data(ix,:); where data(:,1:2) is two first columns (a,b) and a1,b1 values yo...

6 years ago | 0

Load more