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...

2 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*...

2 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...

2 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...

2 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

2 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...

2 days ago | 0

| accepted

Answered

How to deleter specific elements from a matrix without changing its shape

Instead of deleting why not change them to nan? yourMatrix(yourMatrix>0.81)=nan;

How to deleter specific elements from a matrix without changing its shape

Instead of deleting why not change them to nan? yourMatrix(yourMatrix>0.81)=nan;

2 days ago | 0

Answered

How to reassign values to new array without using a loop

[~,idx]=ismember(dataVec2,dataVec1); newMat=oldMat(idx,:);

How to reassign values to new array without using a loop

[~,idx]=ismember(dataVec2,dataVec1); newMat=oldMat(idx,:);

3 days ago | 1

| accepted

Solved

Calculate the Levenshtein distance between two strings

This problem description is lifted from <http://en.wikipedia.org/wiki/Levenshtein_distance>. The Levenshtein distance betwee...

4 days ago

Solved

Smallest distance between a point and a rectangle

Given two points *x* and *y* placed at opposite corners of a rectangle, find the minimal euclidean distance between another poin...

4 days ago

Answered

How to solve this equation?

f=@(h)h.^0.66+0.0805*h-0.045; fzero(f,0.008);%plot(0:.001:.1,f(0:.001:.1)) to get approximate location to root

How to solve this equation?

f=@(h)h.^0.66+0.0805*h-0.045; fzero(f,0.008);%plot(0:.001:.1,f(0:.001:.1)) to get approximate location to root

4 days ago | 0

Answered

How to reorder a vector one cell at a time?

order = [1 3 1 5 1 1 7 1 8 1 1 9 4 1]'; a=order([find(order~=1);find(order==1)]); c=1; while ~isequal(order(:,c),a) c=c+1;...

How to reorder a vector one cell at a time?

order = [1 3 1 5 1 1 7 1 8 1 1 9 4 1]'; a=order([find(order~=1);find(order==1)]); c=1; while ~isequal(order(:,c),a) c=c+1;...

4 days ago | 0