Answered
Make white portions of slice of flow data transparent
An example of how to make some faces transparent [X,Y] = meshgrid(-10:10); % generate mesh Z = -X.^2-Y.^2; ...

6 years ago | 0

| accepted

Answered
calculating and writing sorted results in matlab
Can I use the command dlmwrite with some parameters? Yes you can. example M = [1 2 3; 4 3 2]; dlmwrite('myFile.txt',M,'delim...

6 years ago | 0

Answered
solving 4 equation with 4 unkowns
It's because of the way you concantenate your equations Example of two different declarations [1 - 2] ans = -1 [1 -2] ...

6 years ago | 0

Answered
Tight surface meshing of 3D points
I just looped through all edges and calculated length clc,clear load points.mat ii = 1:50:size(a,1); % i reduced size of...

6 years ago | 0

Answered
Function returns a vector of length 6, but the length of initial conditions vector is 34. The vector returned by ICEMODELFUNC and the initial conditions vector must have the same number of elements.
You want several solution for thetaRAD So just put your ode45 function inside for loop tspan = t0:tdelta:tf; for i = 1:length...

6 years ago | 0

Answered
How created a graph from unordered node list?
Try this x = x(:); y = y(:); plot([x(source) x(target)],[y(source) y(tagrget)]) or patch function fv.vertices = [x(:) y(:)]...

6 years ago | 0

Answered
How can I get velocity values for stream3 function
A short example clc,clear cla load wind [sx sy sz] = meshgrid(80,20:10:50,0:5:15); h = streamline(stream3(x,y,z,u,v,w,sx,sy...

6 years ago | 0

| accepted

Answered
Rotating projectile curve about y-axis
You can create a mesh in polar system of coordinates Assuming t = linspace(0,2*pi,30); % angle r = x; ...

6 years ago | 0

Answered
Plotting a sphere consisting of planes
Use patch for this problem % create data of format % Ax Ay Az % Ax Ay Az % ... % Bx By Bz % Bx By Bz % ... % Cx Cy Cz %...

6 years ago | 0

Answered
tracking object in a video
if these [X_barycentre, Y_barycentre] are coordinates of a center Use imcrop to crop the image h = 50; % side of recta...

6 years ago | 0

| accepted

Answered
What does the output of stlread function represent?
Please see

6 years ago | 0

| accepted

Answered
I have an .avi file, I want to convert it to matrix format.
Use VideoReader v = VideoReader('xylophone.mp4'); numFrames = v.NumberOfFrames; for i = 1:numFrames I = read(v,i); ...

6 years ago | 1

Answered
Second derivative from a smoothing spline fit
Here you go n = 50; x = linspace(0,10,n); y = sin(x).*x; d2y = diff(y,2)./(x(2)-x(1))/2; % second derivative ix = ...

6 years ago | 0

| accepted

Answered
How to draw a 2D histogram from a time series?
My proposition A = importdata('temp_data.csv',','); temp = A.data; time = A.textdata; time(:,2) = []; time(1) = []; ...

6 years ago | 1

Answered
Seperating labeled array areas using contourf
You want x,y coordinates of boundaries? Or what kind of format it should be? clc,clear load areas.mat I = (image_array); lev...

6 years ago | 1

| accepted

Answered
repeat the iteration with an error using try/catch
My proposition for iTcm=1:nTcm for iScen=1:nScen iEv = 0; while iEv <= nEv iEv = iEv + 1...

6 years ago | 0

Answered
cropping a serie of images and save only the cropped part of it
Tri this (not tested) dirName = uigetdir('./', 'Select data folder'); cd(dirName); fname = sprintf('SI380820191011130728_%03...

6 years ago | 0

| accepted

Answered
2D plot to 3D Graph
I made a simple example for you x = 0:10; y = sin(x)+2; t = linspace(0,2*pi,30); [T,Y] = meshgrid(t,y); [~,X] = meshgrid(t,...

6 years ago | 0

| accepted

Answered
ode does not converge
I tried tt = [0 1]; options=odeset('RelTol',1e-3,'AbsTol',1e-3);

6 years ago | 0

| accepted

Answered
I need to get counterlines outside the U.S. removed (Ocean/Canada/Mexico)! Se script below.
Use handler options % Call contourm [~,h] = contourm(LatGrid, LonGrid, OzoneGrid); h1 = get(h,'children'); % for ...

6 years ago | 0

Answered
Legend of a patch-object with a line in the center
What about this? Too complicated? No? clc,clear cla [X,Y,Z] = peaks(5); p = surf2patch(X,Y,Z); p1 = patch(p,'facecolor','g'...

6 years ago | 0

| accepted

Answered
how to plot an image and a logical matrix on same plot
Try this ind = mask > 0.8; img(ind) = max(img(:)); imshow(img)

6 years ago | 0

Answered
How to create an animation by choosing rows in a matrix to switch with time. Truss simulation
Here is my achievement: i just scaled colors while moving

6 years ago | 0

Answered
Finding odd and even values without functions
What about dividing? while 1 a = a/2; if abs(a-1) < 0.01 % if very close to '1' disp('even') ...

6 years ago | 0

| accepted

Answered
Adjusting the transparency of a contour plot using a gradient of alpha values
Here is my today achievement clc,clear opengl software n = 1000; [X,Y,Z] = peaks(20); % surf(X,Y,Z,'facecolor','none') hol...

6 years ago | 0

Answered
Subplot titles on each column.
What about brute force? clc,clear clf subplot 121 plot(0,0) subplot 122 plot(1,1) h1 = annotation('textbox',[0.25 0.95 0....

6 years ago | 0

| accepted

Answered
I want the points that located in a certain polygon
You use different order of lan/lot. Change places in red squares

6 years ago | 1

| accepted

Answered
How do I remove all fields of a structure that have at least one NaN?
Try rmfield a = [1 nan 3]; bb = [1 2 3]; S.a = a; S.bb = bb; S nms = fieldnames(S); for i = 1:length(nms) f = getfie...

6 years ago | 1

Answered
For loop on a 3D matrix to get a range of slices
Use find and sum find(sum(sum(SG,1),2)) % number of nonzero slices

6 years ago | 1

| accepted

Load more