Answered

HI, I wanted to create a new function that plots a scatterplot of 2 columns of data and saves the Figure in a jpg. I was unable to do this using my code and wanted to know why, and what would work. format

It's because of the letter you use. IT should small 's'

HI, I wanted to create a new function that plots a scatterplot of 2 columns of data and saves the Figure in a jpg. I was unable to do this using my code and wanted to know why, and what would work. format

It's because of the letter you use. IT should small 's'

12 dagar 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,...

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,...

12 dagar 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; ...

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; ...

13 dagar 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...

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...

13 dagar ago | 0

| accepted

Answered

Please Help: "Error in odearguments (line 90)" and "Error in ode45 (line 115)"?

Try this modification results

Please Help: "Error in odearguments (line 90)" and "Error in ode45 (line 115)"?

Try this modification results

13 dagar 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...

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...

13 dagar 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; ...

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; ...

14 dagar ago | 0

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

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

14 dagar 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...

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...

14 dagar 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) ...

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) ...

14 dagar 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+...

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+...

14 dagar 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...

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...

14 dagar 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...

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...

15 dagar ago | 0

Answered

How to convert all vector elemens into zeros but not the maximum and the minimum of it?

Try this modification

How to convert all vector elemens into zeros but not the maximum and the minimum of it?

Try this modification

15 dagar ago | 0

| accepted

Answered

I cannot get my function to work which is to find the minimum angle between 2 inputs a and b

Try this modification

I cannot get my function to work which is to find the minimum angle between 2 inputs a and b

Try this modification

15 dagar ago | 1

| accepted

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); ...

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); ...

15 dagar ago | 0

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 ...

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 ...

15 dagar 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(...

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(...

15 dagar 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);

Code detecting false objects

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

15 dagar 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...

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...

15 dagar ago | 0

| 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...

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...

15 dagar 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...

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...

15 dagar 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...

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...

16 dagar ago | 1

| accepted

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...

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...

16 dagar 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....

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....

16 dagar ago | 0

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

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

16 dagar 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...

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...

17 dagar ago | 0

| accepted