Réponse apportée
Plotting chemical 2d reaction in different colors
What about alpha? Try to set transparency to your object and then just plot them together [X1,Y1,Z1] = peaks(20); [X2,Y2] = me...

environ 6 ans il y a | 1

Réponse apportée
For loop that extracts non constant values from a column in an Excel table and outputs the desried value of the selcted row
Use logical operators for this purpose num = xlsread('Testing.xlsx'); tbl = num ; col_2 = tbl(:,2); % Column of values val...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
ode45 change function index when something happends
Try persistent variable function main clc % clear command window clear functions % clear persiste...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Surface plot with custom data tip
Use griddata to interpolate your data xx = linspace(min(X),max(X),20); yy = linspace(min(Y),max(Y),20); [X1,Y1] = meshgrid(xx...

plus de 6 ans il y a | 0

Réponse apportée
Simulating lots of non-interacting particles bouncing around in a 2D box
Here are some notes you can make your code shorter Didn't you forgot about timestep? Use this part of code to check if so...

plus de 6 ans il y a | 0

Réponse apportée
function area = calcarea(rad) ↑ Error: Function definitions are not permitted in this context.
See this simple solution

plus de 6 ans il y a | 0

Réponse apportée
How to draw a tangent line to the curve?(tangent line has to pass through origin)
Here is the success condition: Numerical approach dx = 0.1; f1 = @(x0) (interp1(x,y,x0+dx) - interp1(x,y,x0))/dx; f2 = @...

plus de 6 ans il y a | 0

Réponse apportée
MATLAB Count multiple spheres with overlaps, known number of pixels per sphere, no 3D data available
How to know if sphere are too close? Try to separate them using imdilate I = imread('img1.png'); I1 = im2bw(I); se = strel('d...

plus de 6 ans il y a | 0

Réponse apportée
Contour map to show ocean depth
Use griddata % lat, long, depth - your data [LAT,LON] = meshgrid(lat,long); % create 2D matrices DP = griddata(lat,lo...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Plotting Inclined Rankine Oval
Here is a formula And this is how surface looks like originally Here is the problem part My suggestion is to plot only...

plus de 6 ans il y a | 0

Réponse apportée
How do I apply a tolerance to my code
Use this trick

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Find the time of each collision on a wall of a ball in a 2d box.
See this simple example clear, clc vx = 10*cosd(-30); vy = 10*sind(-30); g = 9.81; % gravity x = 5; % start x y =...

plus de 6 ans il y a | 0

Réponse apportée
How to define a system of differential equations with three variables and calculate their variation with time?
Since your matrices are of 3x3 size the result should be of 3x1 size function dydt = dynamics(t,y,Mt,Ct,Kt) dydt = zeros(6,1);...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
how to increase getframe dimensions and quality ?
Try this madness clc,clear,cla wobj = VideoWriter('test1.avi'); wobj.FrameRate = 10; % frames per second (vi...

plus de 6 ans il y a | 4

Réponse apportée
Help with a script that calculates bending moment of cantilever beam.
I think you are overcomplicated. Look on this idea

plus de 6 ans il y a | 0

Réponse apportée
reshape a photo to 8*8 blocks
Use mat2cell [m,n] = size(img); im = 8*ones(1,m/8); in = 8*ones(1,n/8); img1 = mat2cell(img,im,in); img2 = cat(3,img1{:});

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
How to replace data a specific portion of data within a column of different dimensions?
Here is a trick A1 = load('data1.txt'); A2 = load('data2.txt'); ix = 410:459; A1(ix,1) = A2(ix,1); writetable(table(A1),'da...

plus de 6 ans il y a | 0

Réponse apportée
Hi ,i have problem whit the function quad
Make this modifications

plus de 6 ans il y a | 0

Réponse apportée
Draw a symmetrical shape on the x-axis, y-axis, and origin using the transformation matrix
I used patch x = [3 3 2 3 5 6 5 5]; y = [1 3 3 4 4 3 3 1]; cla patch(x,y,'r'); patch(x,-y,'r'); patch(y,x,'r'); patch(-y,...

plus de 6 ans il y a | 0

Réponse apportée
Not getting direction field for an ode in a proper way.
Correct answer

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How can I plot this figure using MATLAB?
Here is patch use x = 0:0.1:1; y = sqrt(x); cla patch([0 0 0],[0 1 0],[0 0 1],'b') % vertical triangle patch([1 0 x],[...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
double summation in matlab
Here is numerical approach clc,clear % alignComments b = 0.142e-9; gammao = 3.0; m = 101; hbar = 1; e ...

plus de 6 ans il y a | 1

Réponse apportée
2D images into 3D plot
Create 3D object (surface maybe) and use rotate h = surf(peaks); orig1 = [ 0 0 0 ]; ang1 = 15; dir1 = [ 1 0 0]; rotate(h,di...

plus de 6 ans il y a | 0

Réponse apportée
Calculating mean angles of edge detection
Try regionprops with orientation property Example BWd1 = 1.0*BWd; data = regionprops(BWd,'orientation','pixelidxlist'); % g...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How would I integrate different values into 4 tables?
Try this solution

plus de 6 ans il y a | 0

Réponse apportée
Solving stiff ode system with vector parameters.
I found the problem

plus de 6 ans il y a | 0

Réponse apportée
Pre-define a group (plot) properties or passing a group properties in a function
You can use handlers h(1) = plot(..) h(2) = plot(..) set(h,'color','r','linewidth',2)

plus de 6 ans il y a | 0

Réponse apportée
Geoshow and pcolor not plotting correctly
See this example clc,clear clf peaksData = ncread('example.nc','peaks'); [m,n] = size(peaksData); [lat,lon] = ndgrid(1:m,1...

plus de 6 ans il y a | 0

Réponse apportée
ODE45 in Maxwell-Stefan equation
Here is the solution: f = @(t,y) 1/c/D*(y*(NH2+NH2O)-NH20); [t,y] = ode45(f,[0 2.5e-4],1);

plus de 6 ans il y a | 0

Charger plus