Solved


Classify product/digit-sum sequences
Cody Problem 53120 involved a sequence in which a term is computed by multiplying the previous two terms and adding the digits o...

4 years ago

Solved


Time Expansion
How can you slow down any discrete-time signal? Example Input original signal x. x = [1 2 3 -1 -2 -5 -4] We want t...

4 years ago

Answered
Determining the hourly time series from 5 minutes and 15 minutes time series data
It you were not missing data it would be an easy reshape. I think you are going to need to do datenum ranges. Convert first colu...

4 years ago | 0

Answered
I tried to solve projectile motion problem (velocity about physic) with matlab . I have some troubles ... Please help me immediately
Help immediately? Lucky to get a response. g=9.80665; T=37; V0=100; Vx=V0*cosd(T); Vy=V0*sind(T); tu=Vy/g; t=0:.001:tu; ...

4 years ago | 0

| accepted

Answered
Compare two matrices and only get as similar rows based on two columns
Once your format your matrices properly. newMatrix=matrix1(ismember(matrix1(:,[4,5]),matrix2(:,[13,14]),'rows'),:);

4 years ago | 0

| accepted

Answered
How to keep rows whose values follow a certain sequence?
s=strfind(num2str(yourMatrix(:,1))','123'); newMatrix=[]; for k=1:length(s) newMatrix=[newMatrix;yourMatrix(s(k):s(k)+2,:)]...

4 years ago | 0

Answered
how to find the nearest value (if a value is already provided) from a given array?
[~,idx]=min(abs(m-x)); M=m(idx);

4 years ago | 0

Answered
Open multiple timetables within an array into one matrix
A simple loop should do the trick. T=yourCell{1}; for k=2:length(yourCell) T=[T;yourCell{k}]; end

4 years ago | 2

| accepted

Answered
sum the elements in each row of a two-column matrix with the condition that one of the two values in each row is zero
s=sum(A,2); idx=A(:,1)==0|A(:,2)==0; s=s(idx);%sum of all rows where one of the columns==0 notZero=find(~idx);%row index of A...

4 years ago | 0

| accepted

Answered
How to take a data form text file to put it in another file?
See what readmatrix gives you m=readmatrix('File.1.node.txt'); m(1,:)=[]; writematrix(m,'Node.dat'); If you do not attach th...

4 years ago | 0

Answered
How to find out if a logical array is all zeros?
if all(~yourArray)

4 years ago | 1

Answered
Extracting values from array separated by zeros
yourArray = [0 0 0 0 0 2 3 4 5 0 0 0 0 0 1 1 2 3 0 0 0 0 0 0 4 5 1 2 0 0 0 0]; newMatrix=reshape(yourArray(yourArray~=0),4,[]);...

4 years ago | 0

Answered
Create loop to extract mean of every 100 values
newMatrix=reshape(mean(reshape(yourMatrix,100,[])),240,[]);%columns are each array

4 years ago | 1

Answered
Join columns from multiple tables to make 1 really long column
Do you have a table or matrix? If a table, for a new column matrix as such: m=[T1.Var3;T2.Var3];%not sure what your variables i...

4 years ago | 0

Answered
How do I multiply digits of a given number?
d=num2str(x)-'0';%this gives the digits of a number in an array p=prod(d);%multiplies all the digits p13=d(1)*d(3);%multiples ...

4 years ago | 1

Answered
Save cells containing inconsistent arrays to excel
for k=1:length(M) writematrix(M{k}','myXLSfile.xlsx','WriteMode','append'); end

4 years ago | 0

| accepted

Solved


Find the shortest distance between a point and a straight line.
Given the Cartesian coordinates of three points A, B and C (in a flat Euclidean space), find the shortest distance between the ...

4 years ago

Solved


intervals
Write a function that takes an interval from a to b, and divides it into 6 parts.

4 years ago

Solved


row removal
Remove the nth row from input matrix M and return the resulting matrix in output N.

4 years ago

Solved


vectors counting by 5
Create a vector with numbers from x_min to x_max in increments of 5.

4 years ago

Answered
Why do I get the following error message: Imaginary parts of complex X and/or Y arguments ignored.
t and/or E are complex. When plotting, only the real part is plotted. Check if your error goes away by replacing your plot comma...

4 years ago | 0

Answered
How to plot a point, if it lies within a cube?
a = -pi : pi/2 : pi; ph = pi/4; ampl=150; x = ampl*[cos(a+ph); cos(a+ph)]/cos(ph); y = ampl...

4 years ago | 0

| accepted

Answered
How do I write a projectile motion code that is automated and plots motion given certain heights, angles and initial velocity?
No, access the function with a simple script. velocity=16; figure; hold on; for height=1:2 for angle=30:15:60 d=pro...

4 years ago | 0

| accepted

Solved


Finding neighbors of [-1:1] in a matrix....
Hello All! Well I found this one fun to figure out, all you have to do is make a matrix of 1's or 0's (true or false) that sh...

4 years ago

Solved


Largest territory
Determine whose territory is largest. If there are multiple numbers tied for the largest territory, return the smallest number. ...

4 years ago

Solved


Replace pattern 0 1 0 and 1 0 1
Find and replace a pattern in a row of zeroes and ones. * Find 1 0 1 and replace it with 1 1 1 * Find 0 1 0 and replace it w...

4 years ago

Solved


counting groups!
This problem is about counting groups. Example If you have x: x = [0.8 0.8 0.8 0.3 0.3 0.4 0.5 0.6 0.6 0.9] then a...

4 years ago

Answered
How do I write a projectile motion code that is automated and plots motion given certain heights, angles and initial velocity?
function d = projMotion(velocity,height,angle) Vyi=velocity*sind(angle); g=9.81; tmax=(2*Vyi/g+sqrt((2*Vyi/g)^2+8*height/g))/...

4 years ago | 0

Answered
How do I find the most frequently occurring range of values in a matrix?
use histcounts()

4 years ago | 1

| accepted

Load more