Answered

New to matlab. Trying to make a script to reorganize excel data

a=readcell('yourcellname'); b=unique(a(:,2)); newCell=b'; for k=1:length(b) newCell(2,k)={a(ismember(a(:,2),b{k}),1)}; en...

New to matlab. Trying to make a script to reorganize excel data

a=readcell('yourcellname'); b=unique(a(:,2)); newCell=b'; for k=1:length(b) newCell(2,k)={a(ismember(a(:,2),b{k}),1)}; en...

6 days ago | 0

Answered

Relative Ranking of position in an array

If a is your matrix above. sum(find(a==1)-find(a==2)<0);

Relative Ranking of position in an array

If a is your matrix above. sum(find(a==1)-find(a==2)<0);

6 days ago | 0

| accepted

Answered

Need helping in setting a for loop for the below code

u=unique(condIds,'stable');%not sure if you only want to go through the unique entries; otherwise, you will have duplicates for...

Need helping in setting a for loop for the below code

u=unique(condIds,'stable');%not sure if you only want to go through the unique entries; otherwise, you will have duplicates for...

7 days ago | 0

Answered

Rerun script with different table input

You should always attempt to index. Put all your tables into a single cell array. t{1}=table1; t{2}=table2; %then index into ...

Rerun script with different table input

You should always attempt to index. Put all your tables into a single cell array. t{1}=table1; t{2}=table2; %then index into ...

7 days ago | 0

| accepted

Solved

Cannon Ball

Given g (acceleration due to gravity) and desired altitude x, find the minimum ground velocity of a cannon ball to reach x.

9 days ago

Solved

Basic electricity in a dry situation

⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ &#...

9 days ago

Answered

How to show the iterations and the answers and the graph

Why not use a while loop? m = 68.1; g = 9.81; t = 10; v = 40; f =@(c) (g*m*(1-(exp((-c*t)/m)))/c)-v; err = 1e-10; c = 0.1...

How to show the iterations and the answers and the graph

Why not use a while loop? m = 68.1; g = 9.81; t = 10; v = 40; f =@(c) (g*m*(1-(exp((-c*t)/m)))/c)-v; err = 1e-10; c = 0.1...

9 days ago | 0

Answered

Not seeing second plot data

theta = 0:0.02:1; y = sin(theta); plot(theta, y, theta, 1- (theta - y)./y);%need ./ also to keep it the same scale chose 1 ins...

Not seeing second plot data

theta = 0:0.02:1; y = sin(theta); plot(theta, y, theta, 1- (theta - y)./y);%need ./ also to keep it the same scale chose 1 ins...

9 days ago | 1

Solved

Diophantine Equations (Inspired by Project Euler, problem 66)

Consider the quadratic Diophantine equation of the form: x^2 – Dy^2 = 1 When D=13, the minimal solution in x is 649^2 – 13...

11 days ago

Answered

How can I implement nested for loops to return all the possible combinations

Your missing a few references. Just form a matrix of all possible combinations using meshgrid. No loops needed. WT_r = 1:0.5:30...

How can I implement nested for loops to return all the possible combinations

Your missing a few references. Just form a matrix of all possible combinations using meshgrid. No loops needed. WT_r = 1:0.5:30...

13 days ago | 0

Answered

Find the index that represents a percentage of area

s = 1; mu = 0; xstart = -10; xend = 10; xstep = 0.1; x_range = xstart:xstep:xend; my_pdf = normpdf(x_range,mu,s); figure x=n...

Find the index that represents a percentage of area

s = 1; mu = 0; xstart = -10; xend = 10; xstep = 0.1; x_range = xstart:xstep:xend; my_pdf = normpdf(x_range,mu,s); figure x=n...

13 days ago | 0

| accepted

Answered

For loop output into array

annual_power=zeros(1,12); ref=[18.7633 19.5139 18.7633 15.0107 11.2580 10.5075 11.2580 13.5096 16.5117 17.2623 18.7633]; for i...

For loop output into array

annual_power=zeros(1,12); ref=[18.7633 19.5139 18.7633 15.0107 11.2580 10.5075 11.2580 13.5096 16.5117 17.2623 18.7633]; for i...

13 days ago | 0

Answered

How to do a number selector

I assume you mean something like this. maxNum=50; a=input('lucky dip==1 or choose your own numbers==2'); if a==1 numbers=r...

How to do a number selector

I assume you mean something like this. maxNum=50; a=input('lucky dip==1 or choose your own numbers==2'); if a==1 numbers=r...

15 days ago | 0

| accepted