Solved


Number Puzzle - 085

5 years ago

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

5 years 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*...

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

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

5 years 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

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

5 years 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;

5 years ago | 0

Answered
How to reassign values to new array without using a loop
[~,idx]=ismember(dataVec2,dataVec1); newMat=oldMat(idx,:);

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

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

5 years 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

5 years 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;...

5 years ago | 0

Answered
Logical with complex numbers in a vector
%depends on what you are trying to compare real(t)==0; imag(t)==0; norm(t)==0;

5 years ago | 0

Solved


DNA N-Gram Distribution
Given a string s and a number n, find the most frequently occurring n-gram in the string, where the n-grams can begin at any poi...

5 years ago

Solved


What is the next step in Conway's Life?
Given a matrix A that represents the state of <http://en.wikipedia.org/wiki/Conway's_Game_of_Life Conway's game of Life> at one ...

5 years ago

Solved


Extract Built In Functions and Toolbox Functions from String or Function Handle
Find the Built-In functions and Toolbox functions in either a string or a function handle. Generate a string of alphabetized ...

5 years ago

Answered
Two equations of two unknown angles
fun = @solution; x0 = [0,0]; I = fsolve(fun,x0);%solution function f = solution(x) A=87;B=65;D=92; f(1)=D*sin(200)+A...

5 years ago | 0

Answered
How do I find the average/mean of each row if the data has 150 rows and 3 columns?
If A=(150x3 matrix), then b=mean(A,2);%will be a 150x1 column vector of the averages of each of the 150 rows b=b';%transpose ...

5 years ago | 0

Answered
how to covert char array to num array?
arr={'some'; 'the'; 'time'; 'hour'};%must be cell array since lengths are not the same for k=1:length(arr) arr{k}=double(arr...

5 years ago | 0

| accepted

Answered
logical arry indexing: how to extract columns that match a criterion
b=a(3,:);%whatever row c=a(:,b>=.6&b<=.8);

5 years ago | 1

| accepted

Answered
how do i salve this?
I assume you cannot use the built-in function movsum() movsum(x,3,'Endpoints','discard'); But should be able to use other fun...

5 years ago | 0

Solved


Would you win a raffle?

5 years ago

Answered
Plotting in a Loop Always Return "Vector must be the same length"
Why plot in the loop? for n = 1:x for i = 1:y r(n,i) = rand + i; end end plot(1:y,r,'d');

5 years ago | 0

| accepted

Solved


Upper case and lower case!

5 years ago

Solved


Volume of Cylindrical Shell

5 years ago

Solved


Period of a pendulum

5 years ago

Solved


Angular Velocity

5 years ago

Solved


Area of Cylindrical Shell

5 years ago

Load more