Beantwortet
How to replace all elements that are not even integers?
A different way of doing it - generate a list of random integers much larger than the number you need, and pick out the subset ...

fast 8 Jahre vor | 0

Beantwortet
i want someone t explain it to me
kk iterates over the columns of the matrix There are two columns in the matrix so there will be two iterations of the loop. On t...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
How do I find the first x value when y crosses a threshold and remains above the threshold for 5 consecutive data points
test=[1 2 3 4 3 4 5 6 4 3 3 4 5 10 8 6 4 4 7 6 8 9 10 4 4] threshold=4; index=test>threshold; startAt=regexp(char...

fast 8 Jahre vor | 0

Beantwortet
How does the for-cycle check its conditions?
From the docs: _Avoid assigning a value to the index variable within the loop statements. The for statement overrides any change...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
Setting bounds on a calculated array
It's easy enough to index the places where the values in the vector are greater than 127 or less than 1 indices=charVector<...

fast 8 Jahre vor | 0

Beantwortet
Distribution of binary values
test=[1 1 1 0 0 1 1 1 1 1 0 0 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 0 1] out=regexp(char(test+48),'[0]+|[1]+','match') s...

fast 8 Jahre vor | 0

Beantwortet
Comment out the rest of the code
I suppose you could put in a double %% at line 100 to create a new section, and then just use the run section option on the prev...

fast 8 Jahre vor | 0

Beantwortet
how to concatenate numbers from multiple cells into a single number?
You could store it as a char string a=[1 0 0 0 0 1 1 0 1 0] b=char(a+48)

fast 8 Jahre vor | 0

Beantwortet
How can I remove the ranges from a specific column vector?
del=[1:4 9:12 13:16] k(del)=[]

fast 8 Jahre vor | 1

Beantwortet
can anyone help me to solve this problem?i want xor operation of 2 character arrays how to do xor operation of 2 character arrays?
a=['a' 'b' 'c'] b=['d' 'e' 'f'] c=bitxor(int32(a),int32(b)) If you expressly want the result as a char array you'...

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
concatenating vectors generated with loop
Not really more compact, but it does away with the loop N=10 output=reshape([ones(1,N); 1:N],1,2*N)

fast 8 Jahre vor | 1

Beantwortet
we have created one sparse matrix ,after that there is need to use one formula at the end,we got an error like undefined variable or function maximum but in the formula it s given like that ,plz help with this
Seems like you're calculating the maximum and minimum values with max(p4) and min(p4), but are not assigning them to the variabl...

fast 8 Jahre vor | 0

Beantwortet
choose n elements from array and increase sequentially
dummyMatrix=randi(50,1,100) result=zeros(1,91) for iter=1:91 %extract 10 element window extract=dummyM...

fast 8 Jahre vor | 0

Beantwortet
Index exceeds array bound help
On the last iteration of the loop z=91; you try to index z+1 (92) of array zz (which does not exist). On the last iteration of t...

fast 8 Jahre vor | 1

Beantwortet
Setting all the entry in multiple columns to zero
A(:,3:5)=0

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
I keep getting the error "Index exceeds array bounds". I've looked all over to no avail, please help.
At a guess, you initialize sounds with: %Sounds sound(1)={'bark'}; sound(2)={'meow'}; sound(3)={'neigh'}; sound...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
Compare two vectors and assigning values then adding to a empty vector
result=hue2<hue1 Will return a logical vector with a 1 wherever hue2<hue1 and a 0 otherwise. If you want this as a double r...

fast 8 Jahre vor | 0

Beantwortet
How to generate all combinations of a vector
Generally, perms gives the permutations of a vector eg. >> perms([1 2 3]) ans = 3 2 1 3 ...

fast 8 Jahre vor | 0

Beantwortet
How can I create a new column in a table via if function?
By way of a smaller example - %Create dummy table for the purpose of example tbl=table() tbl.KW=(1:10)' %Copy...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
How can I make a vector of a repeating sequence
repmat([0 0 0 1],1,40)

fast 8 Jahre vor | 6

Beantwortet
Can someone please help me with a loop issue.
E_=0:0.02:0.2 Values are indexed as E_(1), E_(2) and so on

fast 8 Jahre vor | 0

Beantwortet
Concatenate an unknown amount of strings to a master string.
The first thing you are doing in your while loop is setting the finalString to [] - so you lose everything you concatenate toget...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
What can I do to display all the guesses that the user guessed at the end?
A=randi([1,N]); %Chooses random number between 1 and N %Create while loop for guesssing G=0; guesses=[] whil...

fast 8 Jahre vor | 0

Beantwortet
choose samples in for loop
You could use a step in your for statement i.e. for k=1:10:length(X)

fast 8 Jahre vor | 0

Beantwortet
choose elements from a array with condition
extract=rowMatrix(10:10:1000)

fast 8 Jahre vor | 0

Beantwortet
How to select one of the array and change the array data selected with another value ?
datasample=[83 84 82 81 82 86 81 85 87 88]; datasample(datasample==88) = mean(datasample); ...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
storing loop function output in vector
y=Diff>=0 will return a logical array of all elements in Diff that are greater than or equal to 0. You can either just us...

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
How to display averages in new array?
B=[100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100...

fast 8 Jahre vor | 1

Beantwortet
Trying to do repeat math on multiple variables...
Fs = 44100; W_t = [0,150;150,600;600,1700;1700,7000;7000,22050]; W_r = W_t.*(2*pi/Fs) Is that what you want...

fast 8 Jahre vor | 0

Mehr laden