Answered
How can I turn an equation into a string for input?
str2func should work: s = input('Enter the function:\n'); % Enter the function: % '@(a,x) a*sin(x) - 1/2' f = str2func(s); ...

7 years ago | 0

Answered
determine elements belonging to the same group and change coordinates
Just loop through elements clc,clear A = load('wexample_case2.txt'); x = A(:,2:3); y = A(:,4:5); z = A(:,6:7); for i =...

7 years ago | 0

| accepted

Answered
Elseif statement with large table
Will it work? for i = 1:197 i1 = find(newID(i)==ID & newname(i)==name); newmin(i) = min(i1); newmax(i) = max(i1)...

7 years ago | 0

Answered
How to find the previous position in an array where a value is met?
Probably Johannes's version could be faster but mine is simpler to understand clc,clear A = randi([0 1],10,1); % divide...

7 years ago | 0

Answered
Unable to use xlsread to open a file

7 years ago | 0

Answered
Video with horizontal lines
Look for VideoWriter

7 years ago | 0

| accepted

Answered
What's wrong in my simple for cycle code?
You forgot the dot Also you don't need for loop since all your variables are vectors

7 years ago | 0

| accepted

Answered
using inpolygon as a matrix operation
Use colon (:) operator in = inpolygon(xcoord,ycoord,x(:),y(:));

7 years ago | 0

Answered
Detection of 3D blobs with flat surfaces
What about boundary()? Once you have boundary faces: find all neighbour faces for each node If angles between surfaces is ab...

7 years ago | 1

Answered
Finding intersection using Newtons method
The first problem is when you found a root x stops to change Newx = x - (f(x)/df(x)); % always the same because f(x) == ...

7 years ago | 1

Solved


Are all the three given point in the same line?
In this problem the input is the coordinate of the three points in a XY plane? P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) how can...

7 years ago

Solved


Calculate the area of a triangle between three points
Calculate the area of a triangle between three points: P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) these three points are the vert...

7 years ago

Answered
interp1 for matrix
You have to make the same number of rows for Date and U U_new = interp1(Date,U,M1time); % size(Date): 8013x1 % size(U...

7 years ago | 0

| accepted

Answered
Fit a plane to 3D data from image
You have to form vectors of x,y,z the same size. Also i suggest you to reduce your data [m,n] = size(I); [X,Y] = meshgrid(1:m,...

7 years ago | 1

| accepted

Answered
How do I speed up plotting of interactable scatter points?
Creates handler for each point x = rand(3,1); y = rand(3,1); h = plot([x x*0]',[y y*0]','.r'); Select points x = rand(10,1)...

7 years ago | 0

Answered
How to solve this system of ODEs
Look like system of equations It has many solutions. For example d=1:

7 years ago | 0

Answered
how to plot a 3D surface from N by 3 matrix
Look for griddata()

7 years ago | 0

Answered
Making a contour plot with 1-D z values?
You dont so much points for meshgrid, just make FaceColor - interp F = scatteredInterpolant(Re,We,PS); PSg = F(Reg,Weg); h = ...

7 years ago | 0

Answered
Plot temperature variations using colored contours similar to 'surf' option for 3D object.
Simple example for edges clc,clear x = [1 2 1]; y = [1 1 0]; c = rand(3,10); % 10 colors for each node ...

7 years ago | 0

Answered
How to write a legend in latex format
Concatenation? Npc=2; legend1 = ['\Sigma_{i=1}^{', num2str(Npc) ,'Npc} x^\prime_i']; legend(legend1,'Total L_w','Noise');

7 years ago | 0

Answered
Increasing number of points in a plot without ruining the shape
Is it correct? (Not tested) x1red = linspace(xred(1),xblue(end),20); % more points for red curve % scaling red ...

7 years ago | 0

| accepted

Answered
Extract values between successive start stop indexes from a signal
I think there are tricks with vectorizing but i like simple and clear solution even it's slower x0 % your data ...

7 years ago | 0

| accepted

Answered
Fixing a plotting problem over a fixed axes
See attached file dy = max(spirals); indent = linspace(-255+dy, 255-dy,4); y=r*sin(t)+ indent(columns); FOr thicker line ...

7 years ago | 1

| accepted

Answered
Surface plots inside loop
Just collected all data and used griddata()

7 years ago | 0

| accepted

Answered
Draw partial spheroid include a spheroid
Use patch() to generate planes clc,clear R = 10; r = 3; t = linspace(0,pi/2,20); x = [r*cos(t) fliplr(R*cos(t))]; y = [r...

7 years ago | 1

Answered
smooth shading of patches in 3D - partially correct
Changed the script a bit clc,clear run data p = patch('Faces',F,'Vertices',V); set(p, 'FaceColor', [0.95 0.95 0.95]) gri...

7 years ago | 0

Answered
How do i find only the specific date of the maximum temperature?
max can also return index [M,I] = max(a); Read more in help: max suleiman abdullahi, I want you to accept my answer.

7 years ago | 0

Answered
Selecting a point on a scatter plot, saving index of point
You can use pdist2() and min() functions to select closest to your data points clc,clear x = linspace(0,10,20)'; y = sin(x)...

7 years ago | 2

| accepted

Answered
plot a 3D area on a ellipsoid
Chewed a bit

7 years ago | 1

| accepted

Load more