Answered

Create a matrix with non zero entries on the diagonal and subdiagonal and zero elsewhere

eye(4)+diag([2 2 2],1);

Create a matrix with non zero entries on the diagonal and subdiagonal and zero elsewhere

eye(4)+diag([2 2 2],1);

26 minutes ago | 0

Answered

Unable to perform assignment because the left and right sides have a different number of elements

t = (0:.2:50); V = zeros(length(t)); for i=1:length(t) if 0 <= t(i)&&t(i) <= 8 V(i) = 10*t(i)^2-5*t(i); elseif ...

Unable to perform assignment because the left and right sides have a different number of elements

t = (0:.2:50); V = zeros(length(t)); for i=1:length(t) if 0 <= t(i)&&t(i) <= 8 V(i) = 10*t(i)^2-5*t(i); elseif ...

1 hour ago | 1

Answered

Trouble with saving outer loop values

A = [12 4; 1, 25; 4,19]; B = [90, 85; 60, 50; 90,40]; maxval=[]; for w = 1:5 for r = 1...

Trouble with saving outer loop values

A = [12 4; 1, 25; 4,19]; B = [90, 85; 60, 50; 90,40]; maxval=[]; for w = 1:5 for r = 1...

6 hours ago | 0

Answered

I'm a beginner in matlab. I would like to plot a function as function in frequency..

f=1:100e6; capacity=(@f) ;%you need to describe your equation better. The sum*sum is confusing and the size of each variable sh...

I'm a beginner in matlab. I would like to plot a function as function in frequency..

f=1:100e6; capacity=(@f) ;%you need to describe your equation better. The sum*sum is confusing and the size of each variable sh...

9 hours ago | 0

| accepted

Answered

Recursive Function - Bisection

Your problem is with your function. E=1; D=5; Re=1; f=@(x)-1./sqrt(x)-2.*log10(((E/D)/3.7)+2.51./(Re*sqrt(x)));%is this the ...

Recursive Function - Bisection

Your problem is with your function. E=1; D=5; Re=1; f=@(x)-1./sqrt(x)-2.*log10(((E/D)/3.7)+2.51./(Re*sqrt(x)));%is this the ...

3 days ago | 0

Answered

Assigning NaN to certain values

You might try rounding to 4 decimal places first Temp=round(Temp,4); Temp(ismember(Temp,[-177.6600, -177.6500, -177.6300, -177...

Assigning NaN to certain values

You might try rounding to 4 decimal places first Temp=round(Temp,4); Temp(ismember(Temp,[-177.6600, -177.6500, -177.6300, -177...

3 days ago | 0

| accepted

Answered

How to find the index location of repeated consecutive numbers over a tolerance within a vector

This should work better. Did not previously think about multi-digit numbers. n=7;%minimum number of repeats a=num2str(~(diff(A...

How to find the index location of repeated consecutive numbers over a tolerance within a vector

This should work better. Did not previously think about multi-digit numbers. n=7;%minimum number of repeats a=num2str(~(diff(A...

6 days ago | 0

| accepted

Answered

Invalid use of operator...it is saying it has a problem with '&&' in line 52

To continue the line of code you need three dots ... if (3000*x + 1000*y + 2000*z) <= 24000 + tolerance ... && (1000*x + 1000*...

Invalid use of operator...it is saying it has a problem with '&&' in line 52

To continue the line of code you need three dots ... if (3000*x + 1000*y + 2000*z) <= 24000 + tolerance ... && (1000*x + 1000*...

6 days ago | 0

| accepted

Answered

How to find the index location of repeated consecutive numbers over a tolerance within a vector

Likely lots of other ways. n=5;%minimum number of repeats idx=strfind(cell2mat(regexp(num2str(diff(A)),'[^- ]','match')),repma...

How to find the index location of repeated consecutive numbers over a tolerance within a vector

Likely lots of other ways. n=5;%minimum number of repeats idx=strfind(cell2mat(regexp(num2str(diff(A)),'[^- ]','match')),repma...

6 days ago | 0

Answered

Index exceeds the number of array elements (1) ERROR - not sure why.

If you break your script at line 179, you can clearly see the problem. S10 is only a 1x1 array and needs to be a 49x1 like all t...

Index exceeds the number of array elements (1) ERROR - not sure why.

If you break your script at line 179, you can clearly see the problem. S10 is only a 1x1 array and needs to be a 49x1 like all t...

6 days ago | 0

| accepted

Answered

what does x='1' mean

The + converts the characters into their double equivalent so they can be added. double('1')+double('2');% = 99

what does x='1' mean

The + converts the characters into their double equivalent so they can be added. double('1')+double('2');% = 99

7 days ago | 0

| accepted

Answered

what does x=6 means

You can run the code and find out the answer. This is all about logical operations. logical(6)&&logical(7);% by using && it con...

what does x=6 means

You can run the code and find out the answer. This is all about logical operations. logical(6)&&logical(7);% by using && it con...

7 days ago | 0

| accepted