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

alrededor de 6 años hace | 1

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

alrededor de 6 años hace | 0

| aceptada

Respondida
ode45 change function index when something happends
Try persistent variable function main clc % clear command window clear functions % clear persiste...

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

Respondida
function area = calcarea(rad) ↑ Error: Function definitions are not permitted in this context.
See this simple solution

alrededor de 6 años hace | 0

Respondida
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 = @...

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 1

| aceptada

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

alrededor de 6 años hace | 0

Respondida
How do I apply a tolerance to my code
Use this trick

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 4

Respondida
Help with a script that calculates bending moment of cantilever beam.
I think you are overcomplicated. Look on this idea

alrededor de 6 años hace | 0

Respondida
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{:});

alrededor de 6 años hace | 1

| aceptada

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

alrededor de 6 años hace | 0

Respondida
Hi ,i have problem whit the function quad
Make this modifications

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

Respondida
Not getting direction field for an ode in a proper way.
Correct answer

alrededor de 6 años hace | 0

| aceptada

Respondida
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],[...

alrededor de 6 años hace | 0

| aceptada

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

alrededor de 6 años hace | 1

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

| aceptada

Respondida
How would I integrate different values into 4 tables?
Try this solution

alrededor de 6 años hace | 0

Respondida
Solving stiff ode system with vector parameters.
I found the problem

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

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

alrededor de 6 años hace | 0

Cargar más