Solved


Round up to π

5 years ago

Solved


Sum of series IX

5 years ago

Solved


Sum of series VIII

5 years ago

Solved


Input x, output y

5 years ago

Solved


Number Puzzle - 101

5 years ago

Answered
how to select corresponding values to a column
yourMatrix=[(1:100)',randi(100,100,1)]; y=yourMatrix([1,15,30,45,60,75,90,100],2);

5 years ago | 0

| accepted

Answered
Deleting rows from a matrix where cells in adjacent columns are the same. example col1 cell1 = col2 cell1
yourMatrix(find(sum(diff(yourMatrix')'==0,2)),:)=[];

5 years ago | 0

| accepted

Answered
Least square fit, find coefficients
t= [4,5,6,7,10]; f=[1.75,1.73,1.62,1.63,1.49]; p=polyfit(1./t,f,1);%it will work but you need to take reciprocal of t

5 years ago | 1

| accepted

Answered
FOR Loop not giving correct answer
C(:,:,1,1)+C(:,:,1,2); C(:,:,2,1)+C(:,:,2,2);

5 years ago | 0

Answered
How to extract variables from multiple cell arrays and import the variables into two columns
This should work for you if I understand your correctly. m=cell2mat(yourCellarray);

5 years ago | 0

| accepted

Answered
for loops and if statements
Not sure what all the reshaping is about, but to find the indexes of elements in a==5: a=randi(12,12); idx=find(a==5);

5 years ago | 0

Answered
Optimization problem for trigonometric functions
I learned that you take the derivative of the function and set it to zero to find the points of relative minimum and maximum. t...

5 years ago | 0

Answered
Create a monthly datetime sequence
a=datetime(1981,1,1); b=datetime(2019,1,31);%must be year,month,day t1=a:calmonths(1):b; t2=datetime(t1,'Format','yyyy-M-d');...

5 years ago | 1

| accepted

Answered
Nested loop in 3 d matrix
m=[12 10 8 22 18 20 30 10 5 12 18 15 22 28 13 30 32 12 11 16 2...

5 years ago | 1

| accepted

Answered
How to plot parabola?
p=polyfit([0 -3 .5],[2 -1 .75],2); x=-10:.01:10;%whatever you want for x plot(x,polyval(p,x));

5 years ago | 0

| accepted

Answered
Matrix whose elements are the colums numbers
n=100; [a,b]=ind2sub([n,n],1:n^2); b(b==a)=0; b(b>a)=-b(b>a); c=reshape(b,[n,n]);

5 years ago | 0

Answered
How can I use a for loop to get the function to run at multiple values?
n = 1:4; x=0:.01:2*pi; fxn = @(n) sqrt(.5)*sin(((n*pi)*(x-0.6))/4); figure; hold on; for i = 1:length(n) f(i,:) = fxn(...

5 years ago | 0

Answered
vector of random natural numbers to matrix
a=randi(100,1,100); b=unique(a); c=zeros(length(b),100); for k=1:length(b) c(k,:)=a==b(k); end

5 years ago | 0

| accepted

Answered
How to change a bit of matrix from 0 to 1
M(6:11:end)=1;%for your Matrix M

5 years ago | 1

| accepted

Answered
Output equation answer from 1 to 50
f=@(x)x.^2.*sin(x)-x.*cos(x);%any equation of one variable f(1:50)%prints to command window with no ;

5 years ago | 0

Answered
Compacting the code by using an for loop or maybe an struct?
a=Participant.GKMovement==0; GK{1}=Participant.KicksDependent(a); GK{2}=Participant.KicksIndependent(a); GK{3}=Participant.Ki...

5 years ago | 0

Answered
I need help with my code for Odd Vs Even
playerA=randi(2,1,10000); playerB=randi(2,1,10000); scoreA=or(and(playerA==1,playerB==2),and(playerA==2,playerB==2)); scoreB=...

5 years ago | 0

| accepted

Answered
How to create a distance matrix?
coord = [0 10 20 10 -20;0 0 10 20 -40]; c=nchoosek(1:size(coord,2),2); dist=zeros(1,size(c,1)); for k=1:size(c,1) dist(k)=n...

5 years ago | 0

Answered
How to call specific number from polyfit
T = [0 8 16 24 32 40]; Oxy = [14.621 11.843 9.870 8.418 7.305 6.413]; p = polyfit(T,Oxy, 5); figure(2); plot(T,Oxy,0:.1:40,p...

5 years ago | 0

Answered
For Loop - Homework Question
income = initial_income*(1+inflation).^(0:40);

5 years ago | 0

| accepted

Answered
Plotting for loop values
Try indexing h=.1:.1:1; for H = 1:length(h) syms r phi U=((n*EA)/2)*(L_ab*((2*(r/L_ab)*sin(pi/n)-1)^2)+L_bc*(((sind(...

5 years ago | 0

Load more