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

etwa 6 Jahre vor | 1

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 1

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 4

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 1

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 1

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

| akzeptiert

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

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

etwa 6 Jahre vor | 0

Mehr laden