Community Profile

# darova

422 total contributions since 2019

View details...

Contributions in
View by

Remove single pixel width connecting lines between objects
Here is an idea: find large areas and merge them to remove walls I = imread('image.png'); I1 = im2bw(I); % I2 = bwmorph(~I1,'...

8 hours ago | 0

world or continental Maps on slice
Example A = imread('ngc6543a.jpg'); [m,n,~] = size(A); N = 100; % number of points for surface Z ...

9 hours ago | 0

Colouring Tetramesh - Element wise
Manipulate with faceVertexCData property if you want to assing some colors get(p) %% FaceVertexCData = [ (72 by 1) do...

1 day ago | 0

How to draw ellipse and identify its center around numerous points with Lat and Lon ?
You can identify bigger axis of ellipse (and it's angle) using pdist2 or just find two furthermost points.

1 day ago | 0

Connecting dots with straight line in a loop.
Just use plot function plot(x(index),y(index))

2 days ago | 0

Using a loop and counter for parametric equations
Preallocate array before loop E = zeros(3-1+1,22-5+1,6-5+1); for %% E(H,T,h) = ... end

4 days ago | 0

You are almost there! Yyou written function for ode45 but you didn't use it! function yprime = ex3_2ndorder(x,y) %name and dat...

4 days ago | 3

| accepted

How do I create some code that will check angles and select the next point to draw a line to based on smallest angle?
Here is some start What about these? See attached script

4 days ago | 0

Colormap color levels on cursor
Here is direction You have position of cursor in variable pos You can access to FaceVertexCData with command get(h,'FaceVerte...

5 days ago | 0

| accepted

How to assign specific colors to every quiver?
You can manually assign color to each vector clc,clear [x,y] = meshgrid(0:0.2:2,0:0.2:2); u = cos(x).*y; v = sin(x).*y; ...

5 days ago | 0

anyway to give separate color to 'stack' bar plot
Do you have colors you want to paint bars into? for i = 1:length(hBar) h1 = get(hBar(i),'Children'); n = length( get(...

6 days ago | 0

how to plot individual particle velocites in a closed space
Here is what i invented clc,clear A = readtable('ploc.txt'); A1 = A; k = 1; for i = 0:10 ii = (1:561) + 561*i; ...

6 days ago | 0

| accepted

Plotting bacterial growth using odes
How do you know that it is the correct order (why not S,X,P ?) y0 = [X0 S0 P0]; Try this to plot X vs S [t,ysol] = ode45(M,in...

6 days ago | 0

remove outliers from a circumference
Here is an idea: x0 = mean(x); % Choose some center point (maybe approximately) y0 = mean(y); [t,r] ...

6 days ago | 0

| accepted

How would one update the plotted data without resting the figure axes labels and other format elements?
Use hold on command %% FORMATING ELEMENTS figure(1) xlabel('Width, \$m\$','Interpreter','Latex') ylabel('Depth, \$m\$','Interpre...

6 days ago | 0

What are variable scopes?
Example: sections between function .. end are scopes of variables function main x = linspace(0,2); y1 = f1(x); y...

6 days ago | 0

how to code color bar in specific time?
You can manually correct colorbar values h = colorbar; s = datestr( linspace(7e5,7.5e5,10) , 'dd/mm/yyyy' ); set(h,'YtickLabe...

6 days ago | 0

| accepted

Add background colour for certain values in a plot
I couldn't open your data (maybe my MATLAB is older). I created some data and here is an example clc,clear x = linspace(0,20...

6 days ago | 0

| accepted

How to label answers from a function you called in a script?
You just want to pass your functions to SecantMethod if i understood your correctly Type this in the main script syms x1(t) la...

7 days ago | 0

Large dataset legend for two colours
You can use hadlers h1 = plot() hold on h2 = plot() hold off legend(h1,'legend red') legend(h2,'legend blue')

7 days ago | 0

Plotting single graphs per excel sheet
Look HERE how to count sheets in excel

7 days ago | 0

shooting method solving compressible boundary layer equations
bvp4c should work see attached script

7 days ago | 1

| accepted

How to plot a Map with 2 dimensional colorbar?
Here is a way: clc,clear n = 100; I = zeros(n,n,3); h = linspace(0,1/6,n); s = linspace(1,0,n/2); [H,S] = meshgrid(h,s);...

8 days ago | 1

| accepted

Solver for nonlinear second order ODE has large residuals when mass matrix becomes state dependent
Where is this part? B = -K * th(1:N) - (C + CC) * th(m:n) + T_G + T_M1 - T_L ; dydt(m:n) = (J-T_m1)\B; % solv...

8 days ago | 0

How to accelerate my code
What about findpeaks()? X = load('datat.txt'); X1 = X(1:100); [~,ix1] = findpeaks(X1); [~,ix2] = findpeaks(-X1); plot(X1,'....

8 days ago | 0

bar chart with wrong legend referring
Get handlers (put it into for loop) h(nB) = bar(x, data(:,nB), 'FaceColor', map(nB,:),'BarWidth',0.1); And try this w = 0...

8 days ago | 0

| accepted

Equations with Variables & User input
Use coeffs syms x y z eqn = (x + 2*y + 10*z)/2; [c,t] = coeffs(eqn) sum(c.*t) Also try simplify(eqn)

8 days ago | 1

| accepted

how to subs more than one value in one equation
Place variables in square brackets syms x y z eqn = x + 2*y + z; eqn1 = subs(eqn,[x z],[0 0]) % new equation with repl...

8 days ago | 0

How to use the streamline function for a circular area?
You can just make new grid/mesh for your data (standard rectangular, corners are NaN) Here is a way: clc,clear load test.ma...

8 days ago | 1

| accepted