Answered

Colouring Tetramesh - Element wise

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

Colouring Tetramesh - Element wise

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

18 hours ago | 0

Answered

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.

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.

18 hours ago | 0

Answered

Connecting dots with straight line in a loop.

Just use plot function plot(x(index),y(index))

Connecting dots with straight line in a loop.

Just use plot function plot(x(index),y(index))

1 day ago | 0

Answered

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

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

Answered

ode45 2nd order IVP **please help!!**

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

ode45 2nd order IVP **please help!!**

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

Answered

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

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

Answered

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

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

4 days ago | 0

| accepted

Answered

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

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

Answered

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

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

5 days ago | 0

Answered

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

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

5 days ago | 0

| accepted

Answered

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

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

5 days ago | 0

Answered

remove outliers from a circumference

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

remove outliers from a circumference

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

5 days ago | 0

| accepted

Answered

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

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

Answered

What are variable scopes?

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

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

Answered

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

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

Answered

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

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

Answered

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

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

Answered

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

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

Answered

Plotting single graphs per excel sheet

Look HERE how to count sheets in excel

Plotting single graphs per excel sheet

Look HERE how to count sheets in excel

7 days ago | 0

Answered

shooting method solving compressible boundary layer equations

bvp4c should work see attached script

shooting method solving compressible boundary layer equations

bvp4c should work see attached script

7 days ago | 1

| accepted

Answered

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

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

7 days ago | 1

| accepted

Answered

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

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

Answered

How to accelerate my code

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

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

Answered

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

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

Answered

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)

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

Answered

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

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

Answered

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

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

Answered

How to solve nonlinear coupled ode by Shooting method .

Try bvp4c Suggestion: F0 = y(1); %% ... H1 = y(7); % and use these variables to make your code more redable dy(1) ...

How to solve nonlinear coupled ode by Shooting method .

Try bvp4c Suggestion: F0 = y(1); %% ... H1 = y(7); % and use these variables to make your code more redable dy(1) ...

8 days ago | 0

Answered

Vectorizing multiple for loops in Matlab

I changed your code a bit See attached script

Vectorizing multiple for loops in Matlab

I changed your code a bit See attached script

8 days ago | 1

| accepted

Answered

Linking marker face color to colorbar

Try scatter clc,clear cds_BD = [1.1105 1.3124 1.0474 1.0978 1.0852 1.0474 1.0221 1.0347 1.1988]; cd...

Linking marker face color to colorbar

Try scatter clc,clear cds_BD = [1.1105 1.3124 1.0474 1.0978 1.0852 1.0474 1.0221 1.0347 1.1988]; cd...

9 days ago | 0

| accepted