Answered
Confusion with interp3 and interpn
here is an example [x,y] = meshgrid(1:5); z = x.^2 + y.^2/2; [x1,y1] = meshgrid(1:0.5:5); z1 = interp2(x,y,z,x1,y1); % ...

6 years ago | 0

Answered
can it be possible to use odeVectorField
Try this clc,clear syms f(x) g(x) h(x) x Y Pr=10; Le=10; Nt=.1; Nb=.1; [V,y1] = odeToVectorField( diff(f,3) - diff(...

6 years ago | 0

Answered
Plot 3D cylindrical voxels filled or empty (boolean)
I draw your data clc,clear cla load example.mat [m,n,k] = size(diff); [r,t,z] = ndgrid(1:m,1:n,1:k); [x,y] = pol2cart(t,r)...

6 years ago | 1

| accepted

Answered
ode45 for DQ
See this solution

6 years ago | 0

Answered
Why does probabililty distribution for 3D matrix not work with NaN values?
Try this way %% 2) calculate critical probability (lambda) for each grid point lambda_x_neg= zeros(size(U_stat,1),size(U_stat,...

6 years ago | 1

| accepted

Answered
Threshold for Subvolume of figure shown below
Let X,Y and Z be your 3d matrices ff = patch(isosurface(X,Y,Z,V,threshold)); v = ff.vertices; ...

6 years ago | 0

Answered
Drawing a spiraling half circle
Try polyxpoly. Here is a start clc,clear cla [x,y] = pol2cart(-pi/2:.1:pi/2,1); for i = 3:5 r = 5+i; [xc,y...

6 years ago | 0

| accepted

Answered
Please Help: "Error in odearguments (line 90)" and "Error in ode45 (line 115)"?
Try this modification results

6 years ago | 0

| accepted

Answered
Continue program after exponential fit gives inf
Use try and catch for i = 1:10 try f1 = fit(X_axis_data, curve_envelope, 'exp1'); catch ME disp('er...

6 years ago | 0

| accepted

Answered
Filling up the outer surface holes/gaps
HEre is a start: h = strel('disk',5); I1 = imdilate(yellow,h); % imdilate yellow part (bone) I2 = I1 & ~yellow; ...

6 years ago | 0

Answered
Creating a 2D-array with radial and angular components
Create polar coordinates (radius and angle) using meshgrid. Convert data into cartesian system and calculate [R,T] = meshgrid(...

6 years ago | 1

Answered
How can I plot rows from different matrices?
Use for loop for i = 1:12 for j = i+1:13 line(x(i,:),y(j,:),'color',rand(1,3)) end end

6 years ago | 0

| accepted

Answered
How to find a mean value after each 360 degree?
Try this A = importdata('meanvalue.csv',','); %% B = cumsum(diff(A,2,1)); B(end+1,:) = -inf; k = 1; s = 1; for i = 1:size...

6 years ago | 1

| accepted

Answered
Dear bosses, I want to draw the Hopf bifurcation image. Please help me, thank you. There are specific instructions below.
What about this solution? clc,clear cla for j = 0:4 beta = j; F=@(t,y) [0.5-beta*y(1)*y(2)-0.2*y(1) ...

6 years ago | 0

Answered
How can I find integral of a 3-D mesh field?
Volume under the surface can be found as s = 0; for i = 1:size(A,1)-1 for j = 1:size(A,2)-1 s = s + A(i:i+1,j:j+...

6 years ago | 0

Answered
How to plot on 2 figures generated inside a for loop without them overlapping ?
Here is an example how to switch between figures figure(1); plot([0 1],[0 1],'r') line([0 2],[0 1],'col','b') figure(2); pl...

6 years ago | 0

| accepted

Answered
Remove part of (fsurf) surface
Try numerical solution F = matlabFunction(pwr); [X,Y] = meshgrid(300:20:1000); Z = F(X,Y); Z1 = (Y-3/4*X)/10; % l...

6 years ago | 0

Answered
pcolor function axes switch
use meshgrid to create X, Y and Z matrices use surf with cdata property to assign colors Example [X,Z] = meshgrid(-3:.5:3); ...

6 years ago | 0

Answered
Lorentz equation using the Euler method
Try this solution

6 years ago | 2

| accepted

Answered
How to optimize imagesc plot with pixel labels to get a faster frame grab for creating a .avi
Move every possible operations outside the for loop Some exaplanations Simple example clc,clear % create new object ...

6 years ago | 0

| accepted

Answered
partion of a rectangle into small rectangles with gaps
Try imdilate and meshgrid A = zeros(100); [X,Y] = meshgrid(10:20:100); A(X(:),Y(:)) = 1; A1 = imdilate(A,ones(10)); imshow(...

6 years ago | 0

| accepted

Answered
Code detecting false objects
Use threshold to find appropriate objects th = threshold(img); % bw = im2bw(img,th); bw = im2bw(img,th+0.1);

6 years ago | 0

Answered
Offsetting race track centre line data
Try the attached script. It's pretty simple. I leaved some comments so all should be clear There is a function self_inter insid...

6 years ago | 2

| accepted

Answered
How to create a 3D non convex surface (helical ribbon) with a set of points?
Use surf t = linspace(0,5*2*pi,100); T = [t;t]; Z = [t;t+3]/5; [X,Y] = pol2cart(T,T*0+3); surf(X,Y,Z,'edgecolor','none') l...

6 years ago | 0

| accepted

Answered
Resolution of a second-order differential equation for multiple variable parameters
Because your Hzdot function depends on t variable dy(2,1) = -(OmegaR^2/4)*sin(4*x(1))-2*Omegae*alpha*x(2)+gamma*Hzdot(t); Chan...

6 years ago | 1

| accepted

Answered
Identification of rooms in a floorplan
I skeletonized the image and found endpoints with bwmorph. Found shortest distances and connected points I0 = imread('image.jpe...

6 years ago | 1

| accepted

Load more