Answered
Surface Plots of 3D Matrix After sum.
Try B = sum(A); surf(squeeze(B))

6 years ago | 1

| accepted

Answered
How to solve Error using griddedInterpolant The grid vectors are not strictly monotonic increasing?
Error using griddedInterpolant The grid vectors are not strictly monotonic increasing. Maybe it's because of lat? It's decreas...

6 years ago | 0

| accepted

Answered
Convert x,y,z data to surface matrices(2D array)
Make new mesh in spherical V = p.vertices; for i = 1:3 V(:,i) = V(:,i)-mean(V(:,i)); % move to origin end %...

6 years ago | 0

| accepted

Answered
Find knee/elbow of a curve
What about imdilate()? clc,clear I = imread('nett.jpg'); I1 = im2bw(I); I2 = imdilate(I1,ones(20)); Z = 1.0*cat(3,I1,I2...

6 years ago | 0

Answered
Find cycles in an undirected graph
Just use for loop and cells since you already know indices of each polygon s = [1 1 1 2 3 3 4 4 5 6 6 6 8 9 10 10 12 12 13 14 1...

6 years ago | 2

Answered
Fill a matrix after an iteration
Maybe TM = (sum(TMR)>6) .* sum(TMR);

6 years ago | 0

| accepted

Answered
3D Plotting in MATLAB
Use plot3() % Voltage 9 x9 = [ 19 20 21 21 21 21 20 20 20 20 18 ]; y9 = [ 0 10 30 50 70 90 110 120 140 160...

6 years ago | 0

Answered
How to create a new array with variables that did not meet the required parameters.
Try cond = DwellTime>=2 & DwellTime<=2.5; [cond.*DwellTime ~cond.*DwellTime]

6 years ago | 0

Answered
Do not understand Curve intersections code
Intersections just loops through all segments of curves and find all intersections Many of segments have intersections, but i...

6 years ago | 0

Answered
sfit data array output
This code A = xlsread('ASTMG173.xls'); x = A(:,1); y = A(:,3); plot(x,y) Produces Is it the curve you want to approximat...

6 years ago | 0

Answered
Can this for-loop code get faster in some way?
Maybe ismember function can be replaced: dt = 60000; period_interval = 0 : dt : ts_length; n = length(period_interval); for...

6 years ago | 1

Answered
Solving system of nonlinear equation with boundary condition
Use isosurface to visualize roots Use if .. else statement to choose parameter if P > -c^2 T = P; elseif -c^2 < Q && Q ...

6 years ago | 0

Answered
Coupled differential equations kinetic
yprime and y are always connected function [ yprime ] = calibration( t,y,par,par_cali,T,x1,O2) Your input y were in wrong orde...

6 years ago | 1

| accepted

Answered
Solution to ODE in matlab or simulink
I tried to solve this equation first What are constants values? % opengl software G = 2; V = 2.4; Q = 5; J = 1; n0 = 1....

6 years ago | 1

Answered
Trigonometric approximation on symbolic variables
subs works ok for me syms x y Tp Tw eqn{1} = cos(x) + sin(y) - Tp; eqn{2} = 1 + x + sin(x) - Tw; for i = 1:2 eqn{i}...

6 years ago | 0

Answered
Curve fitting function not able to reproduce curve accurately
How it's supposed to be 'Accurately' if you change output data %% some input Data id_cont = [-800,-799,-798,-797,-796,-795,-79...

6 years ago | 0

Answered
Plotting pcolor plot on an image at a particular area.
You can just merge images clc,clear load matlab.mat [m,n] = size(img); [X,Y] = ndgrid(1:m,1:n); Z = (X.*Y).*region; ...

6 years ago | 0

Answered
plot3 is showing axes but not vectors
First of all use these parenthesis to access an element: vector_e(1) MATLAB is MATrix LABoratory. Take an advantage of it % n...

6 years ago | 0

Answered
Which line is the first line that has an intersection with another line? or what is the order of the intersectection points?
Use third output argument of polyxpoly [xc,yc,ix] = polyxpoly(x,y,xd,yd) % ix(:,1) - number of intersected segment in [x,y] da...

6 years ago | 0

| accepted

Answered
Area fill between minimum and maximum axis limit
Use patch()

6 years ago | 1

Answered
Plot legend does not display any lines
Please see THIS solution for colorbar error

6 years ago | 2

| accepted

Answered
How does this Euler's Method for first ODE work?
Here are some basic concepts 1 - function [x,y] = Euler(h, x0, y0, interval_length, func) % h - step in X direction (dx) % x...

6 years ago | 0

Answered
How can I solve a system of ODEs having coefficients in vector form using bvp4c ?
Try this function eqns = odes(x,y,e,x0) global Pr phi Ra Da Fr A1 A2 fdesh fdeshdesh thetadesh; % global variables are...

6 years ago | 1

| accepted

Answered
Rotating values within a meshgrid
So maybe rotate your data and apply griddata() again a = 45; R = [cosd(a) sind(a); -sind(a) cosd(a)]; V = R*[x(:) y(:)]'; xn...

6 years ago | 0

| accepted

Answered
For Loop calculating too slowly
Maybe try [S,M,H] = ndgrid(0:60, 0:60, 0:24); data1 = repmat([2019 9 30],[length(S(:)) 1]); data2 = [H(:) M(:) S(:)]; data =...

6 years ago | 0

Answered
4d plotting with slices
slice() just doesn't use last column and row for displaying colors So i just copied values [X,Y,Z] = meshgrid(0:4, 0:5, 0:4); ...

6 years ago | 0

| accepted

Answered
Why doesn't my blue point move towards my red point?
your initial D_VT (86.02) bigger than D (3.0) while D_VT < D % shoudl be: D_VT > D In your loop you clear previous ...

6 years ago | 0

Answered
Fill line with colors using the heatmap
What about pcolor() clc,clear n = 50; x = linspace(-5,5,n); [X,Y] = meshgrid(x); for i = 1:n y = sinc(x(i))+0.5; ...

6 years ago | 0

| accepted

Answered
solving 4th order ode
Use bvp4c() You already have written your equation as system of first-order equations function dydt = ode4(t,y) L=1;B=0.2...

6 years ago | 0

| accepted

Load more