Answered

Mass transfer partial differential equations

Short example x = linspace(0,2,20)'; % generate some data y = sin(x); plot(x,y,'.-b') xy = ginput(1); ...

Mass transfer partial differential equations

Short example x = linspace(0,2,20)'; % generate some data y = sin(x); plot(x,y,'.-b') xy = ginput(1); ...

9 hours ago | 0

Answered

How do I create a sphere without sphere function that will inflate like a balloon utilizing the getframe function?

Use surf to create a 3D surface rr = linspace(0,0.5,20); tt = linspace(0,2*pi,40); [R,T] = meshgrid(rr,tt); [X,Y] = pol2cart...

How do I create a sphere without sphere function that will inflate like a balloon utilizing the getframe function?

Use surf to create a 3D surface rr = linspace(0,0.5,20); tt = linspace(0,2*pi,40); [R,T] = meshgrid(rr,tt); [X,Y] = pol2cart...

1 day ago | 0

Answered

Differential Algebraic Equations with vectors

Try f = @(t,u) inv(Z)*(J+p*W*pi*Q)*[u(3) u(4)]' + inv(Z)*(V+p*W*pi*Q)*[u(1) u(2)]'; F = @(t,u) [u(3) u(4) ...

Differential Algebraic Equations with vectors

Try f = @(t,u) inv(Z)*(J+p*W*pi*Q)*[u(3) u(4)]' + inv(Z)*(V+p*W*pi*Q)*[u(1) u(2)]'; F = @(t,u) [u(3) u(4) ...

1 day ago | 1

| accepted

Answered

How to find the handle of all markers in plot (already made)?

To set up markerSize to every marker try: h = get(gca,'children'); for i = 1:length(h) if strcmp(get(h(i),'type'),'line')...

How to find the handle of all markers in plot (already made)?

To set up markerSize to every marker try: h = get(gca,'children'); for i = 1:length(h) if strcmp(get(h(i),'type'),'line')...

3 days ago | 0

| accepted

Answered

Ytick Spacing on Bode Plot Magnitude

If you are using subplot ax1 = subplot(211); plot(x1,y1) ax2 = sbuplot(212); plot(x1,y2); set(ax1,'YTick',[1 2 3]) set(a...

Ytick Spacing on Bode Plot Magnitude

If you are using subplot ax1 = subplot(211); plot(x1,y1) ax2 = sbuplot(212); plot(x1,y2); set(ax1,'YTick',[1 2 3]) set(a...

5 days ago | 0

Answered

How to plot a graph in simulated annealing code? How can we know the solution is near the true value?

How can I be confident that the solution is near the true value as the minimum value keeps changing when I run the code? Well, ...

How to plot a graph in simulated annealing code? How can we know the solution is near the true value?

How can I be confident that the solution is near the true value as the minimum value keeps changing when I run the code? Well, ...

5 days ago | 0

Answered

Using Runge Kutta function to solve Rossler equations

Write your f function as x'(t)=-x(t)-y(t) y'(t)=ax(t)+y(t) z'(t)=b+z(t)(x(t)-c) %where I fix parameters say c=5, b=3, a=0.2...

Using Runge Kutta function to solve Rossler equations

Write your f function as x'(t)=-x(t)-y(t) y'(t)=ax(t)+y(t) z'(t)=b+z(t)(x(t)-c) %where I fix parameters say c=5, b=3, a=0.2...

6 days ago | 1

| accepted

Answered

Complement of an Image using loop

Use this trick for i = 1:m % rows for j = 1: round(n/m*(m-i+1)) % columns I(i,j) = original; end ...

Complement of an Image using loop

Use this trick for i = 1:m % rows for j = 1: round(n/m*(m-i+1)) % columns I(i,j) = original; end ...

6 days ago | 0

Answered

Doubt in MATLAB program

Here is the problem Also you have y(1),y(2),y(3). It means that you have 3 initial condition values, also you should have 3 d...

Doubt in MATLAB program

Here is the problem Also you have y(1),y(2),y(3). It means that you have 3 initial condition values, also you should have 3 d...

6 days ago | 1

| accepted

Answered

How to find the center to contour angle in matlab

Use edge to detect contour find (x,y) coordinates (remember x - columns, y - rows) coordinates need to be sorted (hint: divide...

How to find the center to contour angle in matlab

Use edge to detect contour find (x,y) coordinates (remember x - columns, y - rows) coordinates need to be sorted (hint: divide...

6 days ago | 0

Answered

Max change in z within a certain radius of a point

Use logical conditions ix = (x-x0).^2 + (y-y0).^2 < 20^2; z(ix) % all z values around (x0,y0) r=20

Max change in z within a certain radius of a point

Use logical conditions ix = (x-x0).^2 + (y-y0).^2 < 20^2; z(ix) % all z values around (x0,y0) r=20

7 days ago | 0

Answered

exit from the cycle

Use break to exit loop 2) how to work with rows and columns The question is unclear. You can use 2 for loops for i = 1:size(A...

exit from the cycle

Use break to exit loop 2) how to work with rows and columns The question is unclear. You can use 2 for loops for i = 1:size(A...

7 days ago | 1

Answered

Get the Volume of Intersection Between Two 3D Shapes?

Use equations to get intersection lines: Integral can be used to calculate the volume (1/8 of the volume) and

Get the Volume of Intersection Between Two 3D Shapes?

Use equations to get intersection lines: Integral can be used to calculate the volume (1/8 of the volume) and

7 days ago | 0

Answered

Input formula to be used in a function

Use function handle function main f = @(x) 2*x + 1; % function handle func(f,2,3) function res = func(f,a...

Input formula to be used in a function

Use function handle function main f = @(x) 2*x + 1; % function handle func(f,2,3) function res = func(f,a...

7 days ago | 0

Answered

How can I color something in an image with a specific color?

Use this

How can I color something in an image with a specific color?

Use this

7 days ago | 0

| accepted

Answered

Edge detection when the boundaries are clearly marked

Try this: A = imread('test.jpeg'); subplot(1,2,1) imshow(A) RGB = [140 224 226]; % color you want (cyan) % RGB = [...

Edge detection when the boundaries are clearly marked

Try this: A = imread('test.jpeg'); subplot(1,2,1) imshow(A) RGB = [140 224 226]; % color you want (cyan) % RGB = [...

8 days ago | 0

Answered

calling gradient multiple times

It's because of calculation first and last point. gradient does it this way: first_grad = (y2-y1)/dx; second_grad = 1/2*(y4-y3...

calling gradient multiple times

It's because of calculation first and last point. gradient does it this way: first_grad = (y2-y1)/dx; second_grad = 1/2*(y4-y3...

8 days ago | 0

| accepted

Answered

Find the partial minimums in a set of values

Use findpeaks(-data) Choose peaks that lie in 23 < x < 27 and 58 < x < 62

Find the partial minimums in a set of values

Use findpeaks(-data) Choose peaks that lie in 23 < x < 27 and 58 < x < 62

8 days ago | 0

| accepted

Answered

Alternatives to Delaunay triangulation

Volume can be found as summation volume of pyramids. Here is an idea: clc,clear load Coords.txt x = Coords(:,1); y = Coo...

Alternatives to Delaunay triangulation

Volume can be found as summation volume of pyramids. Here is an idea: clc,clear load Coords.txt x = Coords(:,1); y = Coo...

8 days ago | 0

Answered

How can I change the degree symbol in axis tick label while using axesm function?

If you type something like: h = get(gca,'children'); >> get(h(2),'string') You will see that each label has "^" symbol ans =...

How can I change the degree symbol in axis tick label while using axesm function?

If you type something like: h = get(gca,'children'); >> get(h(2),'string') You will see that each label has "^" symbol ans =...

10 days ago | 0

| accepted

Answered

How to make a round bounday on the object

Use edge to detect edge Use find to get coordinates (rows and columns of edge) Calculate some center (approximately) Use ca...

How to make a round bounday on the object

Use edge to detect edge Use find to get coordinates (rows and columns of edge) Calculate some center (approximately) Use ca...

10 days ago | 1

Answered

For loops for 2 variables. (Trajectory)

Piece of a code n = 10; theta2 = linspace(10,90,n); vi = linspace(0,vMAX,n); for i = 1:n % Velocity components...

For loops for 2 variables. (Trajectory)

Piece of a code n = 10; theta2 = linspace(10,90,n); vi = linspace(0,vMAX,n); for i = 1:n % Velocity components...

11 days ago | 0

| accepted

Answered

Crop an image using gride values / coordinates

Here is an attempt clc,clear I = imread('Capture.jpeg'); I1 = im2bw(I); % convert to binary I2 = bwareaop...

Crop an image using gride values / coordinates

Here is an attempt clc,clear I = imread('Capture.jpeg'); I1 = im2bw(I); % convert to binary I2 = bwareaop...

11 days ago | 0

Answered

Guess number game and hint

Use abs function if abs(answer-guess) <= 5 disp('you are close!') end

Guess number game and hint

Use abs function if abs(answer-guess) <= 5 disp('you are close!') end

12 days ago | 0

| accepted

Answered

Plotting a 3D contour graph

Example with interp2 load matlab.mat Z = fv_avg_condensed; [m,n] = size(Z); [X,Y] = meshgrid(1:n,1:m); [Xq,Yq] = meshgr...

Plotting a 3D contour graph

Example with interp2 load matlab.mat Z = fv_avg_condensed; [m,n] = size(Z); [X,Y] = meshgrid(1:n,1:m); [Xq,Yq] = meshgr...

12 days ago | 0

| accepted

Answered

Simulation of tensile test

An example clc,clear % umaxa=163; umaxa=113; umaxb=167; n = 20; area=0.064; rng('shuffle') Umax=umaxa + (umaxb-umaxa)....

Simulation of tensile test

An example clc,clear % umaxa=163; umaxa=113; umaxb=167; n = 20; area=0.064; rng('shuffle') Umax=umaxa + (umaxb-umaxa)....

13 days ago | 0

Answered

convert pattern image to sinusoidal wave

Convert image (rgb2gray) and sum rows

convert pattern image to sinusoidal wave

Convert image (rgb2gray) and sum rows

13 days ago | 0

Answered

The differential equation problem with variable solution by using ode45

Here is an idea [t1,x1] = ode45(@F1,ts,x0); % solve second order [t2,s] = ode45(@(t,s)F2(t,s,t1,x1(:,1)...

The differential equation problem with variable solution by using ode45

Here is an idea [t1,x1] = ode45(@F1,ts,x0); % solve second order [t2,s] = ode45(@(t,s)F2(t,s,t1,x1(:,1)...

14 days ago | 1

| accepted