Respondida
Find mean of rows containing decimal numbers in between integers in a column
Use ismembertol() or ismember() (round values to some tolerance if needed) to find indices of integer values Use loop to find m...

casi 7 años hace | 0

Respondida
Unable to link x-axis in subplot
Example clc,clear x = linspace(0,10); y1 = sin(x)./x; y2 = sin(x)/2; ax(1) = subplot(2,1,1); plot(x,y1) ax(2) = subplot...

casi 7 años hace | 0

| aceptada

Respondida
Generating binary numbers from signal
Just changed an example from link you gave clc,clear fnx = @(x,fn) sin(2*pi*fn*x).*exp(-fn*abs(x)); t = linspace(0,1.2,57...

casi 7 años hace | 0

| aceptada

Respondida
how to generate loop for given program
Then use for loop % a(1) = 2; % a(2) = 3; % a(3) = 4; % a(4) = 5; for i = 1:4 a(i) = i+1; end Simple

casi 7 años hace | 0

Respondida
Issues with the for loop
This should work new_daily_2006 = ids_2006*0; for i = 1:size(ids_2006,1) %* size od ids_2006 is 212*119*177 % i,j,tt ...

casi 7 años hace | 0

Respondida
How can I make my code run faster?
Shorter version of Laplacian_2D function. Is there any connection to gradient and laplacian built-n functions? un = circshift(u...

casi 7 años hace | 0

Respondida
How do you define boundary conditions for ode45 or bvp4c?
In function res: % ya(1) - y at a % ya(2) - dy/dt at a % yb(1) - y at b % yb(2) - dy/dt at b a and b you define in main s...

casi 7 años hace | 0

Respondida
Only include x labels on bottom subplot
Shorter version

casi 7 años hace | 0

Respondida
How to adjust my video to only save 30 fps while in my for loop that goes upto 20000 iterations?
If you want 20 sec video with 30 fps you just need to write 600 frames For dt=0.001 it is 10000 frames for 10 sec simulation so...

casi 7 años hace | 0

| aceptada

Respondida
[DISCONTINUED] MATLAB Answers Wish-list #5 (and bug reports)
I want a button for spoiler Can't believe there is no such option on this forum

casi 7 años hace | 1

Respondida
Plot a vector with different colors on selected data
SOmething like this?

casi 7 años hace | 0

Respondida
Reflection of a fixed point on a 3D plain.
You have straight line ( vector), intersection point P, normal vector of a plane and you want to find vector Find cross produ...

casi 7 años hace | 0

| aceptada

Respondida
Calculating arc length of piece wise cubic polynomial
I think the problem is in your arclength() function for t = ent:0.1:ext xd = 3*a*(t-ent)^2 + 2*b*(t-ent)+ c; ...

casi 7 años hace | 1

| aceptada

Respondida
How to add Hann 5 cycles to the sine wave plot?
One full cycle of sine is 2pi You should make your argument of sine: 0 .. 2pi*5

casi 7 años hace | 1

| aceptada

Respondida
How can we extract objects from a greyscale image?
What about bwareaopen() I = imread('example_filled2.jpg'); I1 = I < 40; I2 = bwareaopen(I1,3e3); imshow(I2) What i've got ...

casi 7 años hace | 0

Respondida
i want to find distances between coordinate points as i explained below?? any help??
With use of pdist2() A = [0 0]; B = [1 0]; C = [2 0]; [x,y] = meshgrid(0:2,1:2); % D G E H F I D_I = [x(:) y(:)]...

casi 7 años hace | 0

| aceptada

Respondida
Saving animation of projectile motion
Am i correct? video = VideoWriter('trajectories.avi', 'MPEG-4'); open(video) for i1 = 1:n1 % draw something F = ...

casi 7 años hace | 0

Respondida
how to do density scatter plot?
C = x*0; for i = 1:length(x) v = (abs(x-x(i)) < R) & (abs(y-y(i)) < R) & (abs(z-z(i)) < R); % how many points in cube...

casi 7 años hace | 1

| aceptada

Respondida
Looking for help to Interpolate a column of data in a timeseries data set
I uploaded your data and tried to visualize it % first column - time Z = data{:,2:end}; Z1 = Z(1:600:end,1:3:end); ...

casi 7 años hace | 0

| aceptada

Respondida
3D plot of function with if statements
THe dot is forgotten Try to write more readable code: [X,Y] = meshgrid(0:0.5:10); %Evaluates the function between 0 and 10 i...

casi 7 años hace | 0

| aceptada

Respondida
Draw contourslice on patch surface
Try to refine mesh of your plane I attached a simple example (help example modified) Can you attach your data

casi 7 años hace | 1

| aceptada

Respondida
How to test if points are inside a point cloud model
Hi. I wrote a script and somehow it works 0_0. See attached script This is what i ahieved Maybe someone can please explain...

casi 7 años hace | 1

| aceptada

Respondida
How to fill and calculate the area between two FFT curves?
You have to find where those curve intersect Use polyxpoly() for example

casi 7 años hace | 0

Respondida
How to plot diagonal lines starting at the last line's end point?
Here is what i achieved Am i succeeded?

casi 7 años hace | 0

| aceptada

Respondida
Use of command reshape
nSpecies = 5; n_ax = 25; n_rad = 10; C0 = [0;0;0;0;In]; Y0 = repmat(C0,n_ax,n_rad); % size of ...

casi 7 años hace | 0

Respondida
How to obtain a surface plot of f(x, y, z) = c
Rewrite expression (x - 31/20)^2 + (x - 981/250)^2 + ... % mininum possible value is 2.81 (x=2.74) (y - 461/100...

casi 7 años hace | 0

Respondida
How can I set 'EdgeLighting' for a patch line across a surface, so it matches the surface lighting?
Can you generate surface like this instead of 3D curve? Then you could just use surfnorm() again and extract normal vector you w...

casi 7 años hace | 1

Respondida
How to get a slice plot from a 3d surface plot for a particular Z value?
I will be happy if you try contour()

casi 7 años hace | 0

| aceptada

Respondida
Extract Plot3 intersection with y=0 plane
If the curve and plane have only one intersection you can use this simple script: % generate some data y = linspace(0,10,3...

casi 7 años hace | 0

| aceptada

Respondida
How can i calculate area under the cyclic curve and max ordinate of every curve?
Use this to find all start points of curves ind = find(diff(x > 0)); ind = [1; ind]; Use trapz to calculate area under the cu...

casi 7 años hace | 0

Cargar más