Answered
Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in Twophasetoground (line 81) Y= [(Y_SU1+Y_DE1) 0 (-Y_DE1) 0 0 0 0 0 0 0 0 0 0;
Rewrite your code as following and see where is the mistake occurs Y(1,:) = [(Y_SU1+Y_DE1) 0 (-Y_DE1) 0 0 0 0 0 0 0 0 0 0]; Y(...

6 years ago | 0

Answered
Making a 3D volume out of splines
Try this clc,clear load Coordinates.txt x = Coordinates(:,1); y = Coordinates(:,2); z = Coordinates(:,3); plot3(x,y,z,...

6 years ago | 0

Answered
Graphs for differents sheets in excel
Try this

6 years ago | 0

Answered
movie of particle tracking in MATLAB
Here is the modified example from MATLAB help. Extract data from streamline and make animation clc,clear [x,y] = meshgrid(0:...

6 years ago | 0

Answered
Calculating second centred difference for FDM - indices for iteration
i think something is wrong here pind = 2 3 4 5 nind = 1 1 2 3 correct way for 1D would be: for i = 2:length(phi)-1 dphi...

6 years ago | 0

Answered
fsolve stopped because of relative size of current step
use for loop syms y psi = 0.1515; r = 0.3; a = r; vf = [5 0]; m = 1; x = linspace(-10*r,10*r); x0 = ones(1,size(x,2)); ...

6 years ago | 0

Answered
How to plot an hexagon or square spiral shape ?
try ths t = 0:pi/2:100; r = t.^2/100; [x,y] = pol2cart(t,r); plot(x,y) pi/2 ...

6 years ago | 2

| accepted

Answered
GRID PROBLEM WANTED TO PUT A GRID ON THE RECTANGLE
here is the way [x,y] = meshgrid(0:10,0:5); plot(x,y,'k') line(x',y','color','k')

6 years ago | 0

Answered
To locate red color and display its pixel size.
Here is start I0 = imread('image.jpeg'); ix = I0(:,:,1) > 220 & I0(:,:,2) < 50 & I0(:,:,3) < 50; mask = uint8( repmat(ix,[1 1...

6 years ago | 0

Answered
Iterate problem for a complex function and plot it.
To extract data from contour use get [C,h] = contour(...); xdata = get(h,'xdata');

6 years ago | 1

| accepted

Answered
How to use do Sobel, dilation at image processing
Try imgradient I0 = imread('image.png'); I1 = rgb2gray(I0); [gmag,gdir] = imgradient(I1); I2 = uint8(gmag); imshow(I2) ...

6 years ago | 0

| accepted

Answered
ODE45 for nonlinear problem
avoid global. YOu can make nested function in your case function linear_vs_nonlinear % variables % code function SD_L=li...

6 years ago | 0

Answered
how to plot 2 colorbars from same set of data in contourf
Create one more colorbar using copyobj Modify colorbars using set function clc,clear clf [x,y,z] = peaks(50); surf(x,y,z) ...

6 years ago | 0

Answered
Probe data from a field in a structure
try this n = numel(sportEvents1); ind = false(n,1); for i = 1:numel(sportEvents1) if any( ismember(sportEvents1(i).frame...

6 years ago | 0

Answered
How to synchronously play video and animated graph?
try this example [x,y] = pol2cart(deg2rad(0:360*5),50); obj = VideoReader('xylophone.mp4'); for i = 1:obj.NumberOfFrames ...

6 years ago | 0

Answered
OdeToVectorField usage with initial conditions
You can easily create matlabFunction from V vector. THe main problem (i think) is correct order of initial conditions You can s...

6 years ago | 0

Answered
How to get the values of biharmonic interpolation - 3D surface fitting
re-create surface manually Use interp2 [x1,y1] = meshgrid(-50:5:50); z1 = fitresult(x1,y1); xx = linspace(-50,50); yy = 2*...

6 years ago | 0

Answered
Create a 3D voxel grid for 3D point cloud
You plot each voxel manually

6 years ago | 0

Answered
Question regarding impoly restraint to move about a specified path
Use setPositionConstraintFcn function function main clc,clear x = 0:.05:10; y = sin(x); plot(x,y,'.-r') h = impoly(gca,[...

6 years ago | 0

| accepted

Answered
How to make plots over each edge of shape?
try this script

6 years ago | 0

Answered
How do I take diagonal Slices?
just create a surface you want to get slice on [x,y,z,v] = flow; [x1,y1] = meshgrid(0:10,-3:0.5:3); z1 = (x1 + y1)/2-2; slic...

6 years ago | 0

Answered
How two find the intersection coordinates between these two functions?
try polyxpoly

6 years ago | 1

| accepted

Answered
How connect the coordinate and fill the area to create a binary mask?
use edge to detect edge pixels use find to find all coordinates use boundary to calculate correct order

6 years ago | 0

Answered
Vector projection on a Plane
Here is the idea: is your normal vector of a plane (ax + by + cz = d). . normalize it so create new vector such that:

6 years ago | 1

Answered
ODE45 specific time point settings
Try tolerance function yprime = big(t,y) m = 1; if any( abs([90 110 200]-t)<0.5 ) m = 2; end

6 years ago | 0

Answered
How to calculate local maximum point from a derivative of a function?
TRY THIS SIMPLE EXAMPLE x = 1:50; y = sin(x); [xc,yc] = polyxpoly(x,y,[0 50],[0 0]); plot(x,y) hold on for i = 1:3 ix...

6 years ago | 0

| accepted

Answered
How to change Change the Angle of the xy axis, from 90° to 60°, and show the grid on ?
What about this? [x,y] = meshgrid(1:10); rot = @(a) [cosd(a) sind(a); -sind(a) cosd(a)]; v1 = rot(60)*[x(:) y(:)]'; x1 = res...

6 years ago | 0

Answered
Merge specific columns of different sheets of single excel file and make a single excel file
Try something like this nms = sheetnames('file.xls'); A1 = []; for i = 1:length(nms) A = readmatrix('file.xls','sheet',i...

6 years ago | 0

Answered
Find the coordinates nearest to the center coordinate of a patch in an image
See this simple example x = rand(100,1); % random data y = rand(100,1); [x1,y1] = meshgrid(0.05:.3:1); ...

6 years ago | 1

| accepted

Load more